Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry
2012-11-30 13:25:45 +00:00
451 changed files with 11579 additions and 2809 deletions

View File

@ -1,10 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/randomProcesses/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
-I$(LIB_SRC)/randomProcesses/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lrandomProcesses \
-lsampling \
-lmeshTools
-lrandomProcesses

View File

@ -5,7 +5,6 @@ EXE_INC = \
-IPDRModels/dragModels/PDRDragModel \
-IlaminarFlameSpeed/SCOPE \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \

View File

@ -116,7 +116,7 @@ void PDRkEpsilon::correct()
}
tmp<volTensorField> tgradU = fvc::grad(U_);
volScalarField G("RASModel.G", mut_*(tgradU() && dev(twoSymm(tgradU()))));
volScalarField G(type() + ".G", mut_*(tgradU() && dev(twoSymm(tgradU()))));
tgradU.clear();
// Update espsilon and G at the wall

View File

@ -5,7 +5,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
@ -17,5 +17,5 @@ EXE_LIBS = \
-lreactionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels \
-lfiniteVolume \
-lmeshTools
-lmeshTools \
-lfiniteVolume

View File

@ -20,6 +20,5 @@ EXE_LIBS = \
-lfluidThermophysicalModels \
-lspecie \
-lfiniteVolume \
-lsampling \
-lmeshTools \
-lfieldSources

View File

@ -30,7 +30,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "mapDistribute.H"
#include "fvCFD.H"
#include "turbulenceModel.H"
#include "basicReactingCloud.H"

View File

@ -1,5 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lfiniteVolume
-lfiniteVolume \
-lsampling

View File

@ -7,6 +7,10 @@ tmp<fvVectorMatrix> UEqn
+ turbulence->divDevReff(U)
);
mrfZones.addCoriolis(UEqn());
pZones.addResistance(UEqn());
UEqn().relax();
sources.constrain(UEqn());

View File

@ -0,0 +1,4 @@
IOMRFZoneList mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U);
IOporosityModelList pZones(mesh);

View File

@ -15,6 +15,8 @@ surfaceScalarField phiHbyA
adjustPhi(phiHbyA, U, p);
mrfZones.relativeFlux(phiHbyA);
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,7 +28,10 @@ Description
Large time-step transient solver for incompressible, flow using the PIMPLE
(merged PISO-SIMPLE) algorithm.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
Sub-models include:
- turbulence modelling, i.e. laminar, RAS or LES
- porosity (explicit treatment)
- Multiple Reference Frame (MRF)
\*---------------------------------------------------------------------------*/
@ -37,6 +40,8 @@ Description
#include "turbulenceModel.H"
#include "pimpleControl.H"
#include "IObasicSourceList.H"
#include "IOporosityModelList.H"
#include "IOMRFZoneList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -46,6 +51,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createZones.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);

View File

@ -10,8 +10,8 @@
mrfZones.addCoriolis(UEqn());
sources.constrain(UEqn());
UEqn().relax();
sources.constrain(UEqn());
solve(UEqn() == -fvc::grad(p));

View File

@ -0,0 +1,3 @@
Test-reconstruct.C
EXE = $(FOAM_USER_APPBIN)/Test-reconstruct

View File

@ -0,0 +1,4 @@
EXE_INC = -g \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = -lfiniteVolume

View File

@ -0,0 +1,61 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Application
Test-reconstruct
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
surfaceScalarField phi(vector(1, 0, 0) & mesh.Sf());
volVectorField Uphi
(
IOobject
(
"Uphi",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
fvc::reconstruct(phi)
);
Uphi.write();
return 0;
}
// ************************************************************************* //

View File

@ -17,7 +17,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(LIB_SRC)/edgeMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude
@ -30,6 +30,6 @@ EXE_LIBS = \
-ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
-ledgeMesh \
-lsampling \
-lfileFormats \
-ltriSurface \
-ldynamicMesh

View File

@ -17,7 +17,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(LIB_SRC)/edgeMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I../vectorTools
@ -25,5 +25,6 @@ EXE_INC = \
EXE_LIBS = \
-lmeshTools \
-ledgeMesh \
-lfileFormats \
-ltriSurface \
-ldynamicMesh

View File

@ -11,10 +11,11 @@ EXE_INC = \
-I../conformalVoronoiMesh/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(LIB_SRC)/edgeMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \
@ -24,8 +25,9 @@ EXE_LIBS = \
-lconformalVoronoiMesh \
-ldecompositionMethods /* -L$(FOAM_LIBBIN)/dummy -lscotchDecomp */ \
-ledgeMesh \
-lsampling \
-ltriSurface \
-lmeshTools \
-lfileFormats \
-lsampling \
-ldynamicMesh \
-lfiniteVolume

View File

@ -9,7 +9,7 @@ EXE_INC = \
-I$(FASTDUALOCTREE_SRC_PATH) \
-I../conformalVoronoiMesh/lnInclude \
-I$(LIB_SRC)/edgeMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
@ -22,7 +22,7 @@ EXE_LIBS = \
-lconformalVoronoiMesh \
-ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lscotchDecomp \
-ledgeMesh \
-lsampling \
-lfileFormats \
-ltriSurface \
-lmeshTools \
-ldynamicMesh

View File

@ -3,7 +3,7 @@ EXE_INC = \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(LIB_SRC)/mesh/autoMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/edgeMesh/lnInclude \
@ -14,6 +14,6 @@ EXE_LIBS = \
-ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
-lmeshTools \
-lsampling \
-lfileFormats \
-ldynamicMesh \
-lautoMesh

View File

@ -337,7 +337,7 @@ addLayersControls
// Advanced settings
// When not to extrude surface. 0 is flat surface, 90 is when two faces
// make straight angle.
// are perpendicular
featureAngle 60;
// At non-patched sides allow mesh to slip if extrusion direction makes

View File

@ -471,6 +471,47 @@ autoPtr<mapPolyMesh> reorderMesh
true
);
// Re-do the faceZones
{
faceZoneMesh& faceZones = mesh.faceZones();
faceZones.clearAddressing();
forAll(faceZones, zoneI)
{
faceZone& fZone = faceZones[zoneI];
labelList newAddressing(fZone.size());
boolList newFlipMap(fZone.size());
forAll(fZone, i)
{
label oldFaceI = fZone[i];
newAddressing[i] = reverseFaceOrder[oldFaceI];
if (flipFaceFlux.found(newAddressing[i]))
{
newFlipMap[i] = !fZone.flipMap()[i];
}
else
{
newFlipMap[i] = fZone.flipMap()[i];
}
}
fZone.resetAddressing(newAddressing, newFlipMap);
}
}
// Re-do the cellZones
{
cellZoneMesh& cellZones = mesh.cellZones();
cellZones.clearAddressing();
forAll(cellZones, zoneI)
{
cellZones[zoneI] = UIndirectList<label>
(
reverseCellOrder,
cellZones[zoneI]
)();
}
}
return autoPtr<mapPolyMesh>
(
new mapPolyMesh

View File

@ -1,3 +1,6 @@
cellSelection/cellSelection.C
cellSelection/badQualityCellSelection.C
cellSelection/outsideCellSelection.C
subsetMesh.C
EXE = $(FOAM_APPBIN)/subsetMesh

View File

@ -1,8 +1,11 @@
EXE_INC = \
-IcellSelection \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-ldynamicMesh \
-lmeshTools \
-lgenericPatchFields

View File

@ -0,0 +1,95 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "badQualityCellSelection.H"
#include "addToRunTimeSelectionTable.H"
#include "faceSet.H"
#include "polyMesh.H"
#include "motionSmoother.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace cellSelections
{
defineTypeNameAndDebug(badQualityCellSelection, 0);
addToRunTimeSelectionTable
(
cellSelection,
badQualityCellSelection,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cellSelections::badQualityCellSelection::badQualityCellSelection
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
)
:
cellSelection(name, mesh, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cellSelections::badQualityCellSelection::~badQualityCellSelection()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::cellSelections::badQualityCellSelection::select
(
boolList& selectedCell
) const
{
//- Delete cell of any face in error
faceSet faces(mesh_, "meshQualityFaces", mesh_.nFaces()/100+1);
motionSmoother::checkMesh(false, mesh_, dict_, faces);
label nFaces = returnReduce(faces.size(), sumOp<label>());
if (nFaces > 0)
{
faces.sync(mesh_);
forAllConstIter(faceSet, faces, iter)
{
label faceI = iter.key();
selectedCell[mesh_.faceOwner()[faceI]] = false;
if (mesh_.isInternalFace(faceI))
{
selectedCell[mesh_.faceNeighbour()[faceI]] = false;
}
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,101 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::cellSelections::badQualityCellSelection
Description
Deselect bad quality cells
SourceFiles
badQualityCellSelection.C
\*---------------------------------------------------------------------------*/
#ifndef badQualityCellSelection_H
#define badQualityCellSelection_H
#include "cellSelection.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace cellSelections
{
/*---------------------------------------------------------------------------*\
Class badQualityCellSelection Declaration
\*---------------------------------------------------------------------------*/
class badQualityCellSelection
:
public cellSelection
{
public:
//- Runtime type information
TypeName("badQuality");
// Constructors
//- Construct from dictionary
badQualityCellSelection
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
);
//- Clone
autoPtr<cellSelection> clone() const
{
notImplemented("autoPtr<cellSelection> clone() const");
return autoPtr<cellSelection>(NULL);
}
//- Destructor
virtual ~badQualityCellSelection();
// Member Functions
virtual void select(boolList&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace cellSelections
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "cellSelection.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(cellSelection, 0);
defineRunTimeSelectionTable(cellSelection, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cellSelection::cellSelection
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
)
:
name_(name),
mesh_(mesh),
dict_(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cellSelection::~cellSelection()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::cellSelection> Foam::cellSelection::New
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
)
{
const word sampleType(dict.lookup("type"));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(sampleType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"cellSelection::New"
"(const word&, const polyMesh&, const dictionary&)"
) << "Unknown cellSelection type "
<< sampleType << nl << nl
<< "Valid cellSelection types : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<cellSelection>(cstrIter()(name, mesh, dict));
}
Foam::label Foam::cellSelection::count(const boolList& lst)
{
label n = 0;
forAll(lst, i)
{
if (lst[i])
{
n++;
}
}
return returnReduce(n, sumOp<label>());
}
// ************************************************************************* //

View File

@ -0,0 +1,149 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::cellSelection
Description
Cell selection methods in subsetMesh
SourceFiles
cellSelection.C
\*---------------------------------------------------------------------------*/
#ifndef cellSelection_H
#define cellSelection_H
#include "dictionary.H"
#include "typeInfo.H"
#include "runTimeSelectionTables.H"
#include "autoPtr.H"
#include "boolList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class polyMesh;
/*---------------------------------------------------------------------------*\
Class cellSelection Declaration
\*---------------------------------------------------------------------------*/
class cellSelection
{
protected:
// Protected data
//- Name
const word name_;
//- Reference to mesh
const polyMesh& mesh_;
//- Input dictionary
const dictionary dict_;
public:
//- Runtime type information
TypeName("cellSelection");
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
cellSelection,
dictionary,
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
),
(name, mesh, dict)
);
// Constructors
//- Construct from dictionary
cellSelection
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
);
//- Clone
autoPtr<cellSelection> clone() const
{
notImplemented("autoPtr<cellSelection> clone() const");
return autoPtr<cellSelection>(NULL);
}
// Selectors
//- Return a reference to the selected cellSelection
static autoPtr<cellSelection> New
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
);
//- Destructor
virtual ~cellSelection();
// Member Functions
//- Count global number of selected elements
static label count(const boolList&);
const word& name() const
{
return name_;
}
virtual void select(boolList&) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,406 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "outsideCellSelection.H"
#include "addToRunTimeSelectionTable.H"
#include "faceSet.H"
#include "polyMesh.H"
#include "motionSmoother.H"
#include "regionSplit.H"
#include "syncTools.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace cellSelections
{
defineTypeNameAndDebug(outsideCellSelection, 0);
addToRunTimeSelectionTable(cellSelection, outsideCellSelection, dictionary);
}
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::cellSelections::outsideCellSelection::generateField
(
const word& name,
const boolList& lst
) const
{
const fvMesh& mesh = dynamic_cast<const fvMesh&>(mesh_);
tmp<volScalarField> tfld
(
new volScalarField
(
IOobject
(
name,
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar(name, dimless, 0),
zeroGradientFvPatchScalarField::typeName
)
);
scalarField& fld = tfld().internalField();
forAll(fld, celli)
{
fld[celli] = 1.0*lst[celli];
}
tfld().correctBoundaryConditions();
return tfld;
}
void Foam::cellSelections::outsideCellSelection::markRegionFaces
(
const boolList& selectedCell,
boolList& regionFace
) const
{
// Internal faces
const labelList& faceOwner = mesh_.faceOwner();
const labelList& faceNeighbour = mesh_.faceNeighbour();
forAll(faceNeighbour, faceI)
{
if
(
selectedCell[faceOwner[faceI]]
!= selectedCell[faceNeighbour[faceI]]
)
{
regionFace[faceI] = true;
}
}
// Swap neighbour selectedCell state
boolList nbrSelected;
syncTools::swapBoundaryCellList(mesh_, selectedCell, nbrSelected);
// Boundary faces
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
forAll(pbm, patchI)
{
const polyPatch& pp = pbm[patchI];
const labelUList& faceCells = pp.faceCells();
forAll(faceCells, i)
{
label faceI = pp.start()+i;
label bFaceI = faceI-mesh_.nInternalFaces();
if
(
selectedCell[faceCells[i]]
!= selectedCell[nbrSelected[bFaceI]]
)
{
regionFace[faceI] = true;
}
}
}
}
Foam::boolList Foam::cellSelections::outsideCellSelection::findRegions
(
const bool verbose,
const regionSplit& cellRegion
) const
{
boolList keepRegion(cellRegion.nRegions(), false);
forAll(locationsInMesh_, i)
{
// Find the region containing the insidePoint
label cellI = mesh_.findCell(locationsInMesh_[i]);
label keepRegionI = -1;
label keepProcI = -1;
if (cellI != -1)
{
keepRegionI = cellRegion[cellI];
keepProcI = Pstream::myProcNo();
}
reduce(keepRegionI, maxOp<label>());
keepRegion[keepRegionI] = true;
if (verbose)
{
reduce(keepProcI, maxOp<label>());
Info<< "Found location " << locationsInMesh_[i]
<< " in cell " << cellI << " on processor " << keepProcI
<< " in global region " << keepRegionI
<< " out of " << cellRegion.nRegions() << " regions." << endl;
}
}
return keepRegion;
}
void Foam::cellSelections::outsideCellSelection::unselectOutsideRegions
(
boolList& selectedCell
) const
{
// Determine faces on the edge of selectedCell
boolList blockedFace(mesh_.nFaces(), false);
markRegionFaces(selectedCell, blockedFace);
// Determine regions
regionSplit cellRegion(mesh_, blockedFace);
// Determine regions containing locationsInMesh_
boolList keepRegion(findRegions(true, cellRegion));
// Go back to bool per cell
forAll(cellRegion, cellI)
{
if (!keepRegion[cellRegion[cellI]])
{
selectedCell[cellI] = false;
}
}
}
void Foam::cellSelections::outsideCellSelection::shrinkRegions
(
boolList& selectedCell
) const
{
// Select points on unselected cells and boundary
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
boolList boundaryPoint(mesh_.nPoints(), false);
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
forAll(pbm, patchI)
{
const polyPatch& pp = pbm[patchI];
if (!pp.coupled() && !isA<emptyPolyPatch>(pp))
{
forAll(pp, i)
{
const face& f = pp[i];
forAll(f, fp)
{
boundaryPoint[f[fp]] = true;
}
}
}
}
forAll(selectedCell, cellI)
{
if (!selectedCell[cellI])
{
const labelList& cPoints = mesh_.cellPoints(cellI);
forAll(cPoints, i)
{
boundaryPoint[cPoints[i]] = true;
}
}
}
syncTools::syncPointList(mesh_, boundaryPoint, orEqOp<bool>(), false);
// Select all cells using these points
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
label nChanged = 0;
forAll(boundaryPoint, pointI)
{
if (boundaryPoint[pointI])
{
const labelList& pCells = mesh_.pointCells(pointI);
forAll(pCells, i)
{
label cellI = pCells[i];
if (selectedCell[cellI])
{
selectedCell[cellI] = false;
nChanged++;
}
}
}
}
}
void Foam::cellSelections::outsideCellSelection::erode
(
boolList& selectedCell
) const
{
//Info<< "Entering shrinkRegions:" << count(selectedCell) << endl;
//generateField("selectedCell_before", selectedCell)().write();
// Now erode and see which regions get disconnected
boolList shrunkSelectedCell(selectedCell);
for (label iter = 0; iter < nErode_; iter++)
{
shrinkRegions(shrunkSelectedCell);
}
//Info<< "After shrinking:" << count(shrunkSelectedCell) << endl;
//generateField("shrunkSelectedCell", shrunkSelectedCell)().write();
// Determine faces on the edge of shrunkSelectedCell
boolList blockedFace(mesh_.nFaces(), false);
markRegionFaces(shrunkSelectedCell, blockedFace);
// Find disconnected regions
regionSplit cellRegion(mesh_, blockedFace);
// Determine regions containing insidePoints
boolList keepRegion(findRegions(true, cellRegion));
// Extract cells in regions that are not to be kept.
boolList removeCell(mesh_.nCells(), false);
forAll(cellRegion, cellI)
{
if (shrunkSelectedCell[cellI] && !keepRegion[cellRegion[cellI]])
{
removeCell[cellI] = true;
}
}
//Info<< "removeCell before:" << count(removeCell) << endl;
//generateField("removeCell_before", removeCell)().write();
// Grow removeCell
for (label iter = 0; iter < nErode_; iter++)
{
// Grow selected cell in regions that are not for keeping
boolList boundaryPoint(mesh_.nPoints(), false);
forAll(removeCell, cellI)
{
if (removeCell[cellI])
{
const labelList& cPoints = mesh_.cellPoints(cellI);
forAll(cPoints, i)
{
boundaryPoint[cPoints[i]] = true;
}
}
}
syncTools::syncPointList(mesh_, boundaryPoint, orEqOp<bool>(), false);
// Select all cells using these points
label nChanged = 0;
forAll(boundaryPoint, pointI)
{
if (boundaryPoint[pointI])
{
const labelList& pCells = mesh_.pointCells(pointI);
forAll(pCells, i)
{
label cellI = pCells[i];
if (!removeCell[cellI])
{
removeCell[cellI] = true;
nChanged++;
}
}
}
}
}
//Info<< "removeCell after:" << count(removeCell) << endl;
//generateField("removeCell_after", removeCell)().write();
// Unmark removeCell
forAll(removeCell, cellI)
{
if (removeCell[cellI])
{
selectedCell[cellI] = false;
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cellSelections::outsideCellSelection::outsideCellSelection
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
)
:
cellSelection(name, mesh, dict),
locationsInMesh_(dict.lookup("locationsInMesh")),
nErode_(readLabel(dict.lookup("nErodeLayers")))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cellSelections::outsideCellSelection::~outsideCellSelection()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::cellSelections::outsideCellSelection::select
(
boolList& selectedCell
) const
{
// Unselect all disconnected regions
unselectOutsideRegions(selectedCell);
if (nErode_ > 0)
{
erode(selectedCell);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,145 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::cellSelections::outsideCellSelection
Description
Deselect cells not reachable from 'inside' points
SourceFiles
outsideCellSelection.C
\*---------------------------------------------------------------------------*/
#ifndef outsideCellSelection_H
#define outsideCellSelection_H
#include "cellSelection.H"
#include "pointField.H"
#include "boolList.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class regionSplit;
namespace cellSelections
{
/*---------------------------------------------------------------------------*\
Class outsideCellSelection Declaration
\*---------------------------------------------------------------------------*/
class outsideCellSelection
:
public cellSelection
{
// Private data
//- Locations to keep
const pointField locationsInMesh_;
//- Number of layers to erode
const label nErode_;
// Private Member Functions
//- For debugging: generate volScalarField with 1.0 for all true
tmp<volScalarField> generateField
(
const word& name,
const boolList& lst
) const;
//- Mark faces inbetween selected and unselected elements
void markRegionFaces
(
const boolList& selectedCell,
boolList& regionFace
) const;
//- Determine for every disconnected region in the mesh whether
// it contains a locationInMesh
boolList findRegions(const bool verbose, const regionSplit&) const;
//- Unselect regions not containing a locationInMesh
void unselectOutsideRegions(boolList& selectedCell) const;
//- Unselect one layer of cells from selectedCell
void shrinkRegions(boolList& selectedCell) const;
//- Erode a given number of layers from selectedCell. Remove any
// region that gets disconnected that way.
void erode(boolList& selectedCell) const;
public:
//- Runtime type information
TypeName("outside");
// Constructors
//- Construct from dictionary
outsideCellSelection
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
);
//- Clone
autoPtr<cellSelection> clone() const
{
notImplemented("autoPtr<cellSelection> clone() const");
return autoPtr<cellSelection>(NULL);
}
//- Destructor
virtual ~outsideCellSelection();
// Member Functions
//- Apply this selector
virtual void select(boolList&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace cellSelections
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,12 +37,12 @@ Description
#include "cellSet.H"
#include "IOobjectList.H"
#include "volFields.H"
#include "cellSelection.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
void subsetVolFields
(
@ -152,12 +152,21 @@ int main(int argc, char *argv[])
{
argList::addNote
(
"select a mesh subset based on a cellSet"
"select a mesh subset based on a provided cellSet and/or"
" selection criteria"
);
argList::addBoolOption
(
"dict",
"read mesh subset selection criteria"
" from system/subsetMeshDict"
);
argList::addOption
(
"cellSet",
"name",
"operates on specified cellSet name"
);
#include "addOverwriteOption.H"
#include "addRegionOption.H"
argList::validArgs.append("cellSet");
argList::addOption
(
"patch",
@ -165,23 +174,81 @@ int main(int argc, char *argv[])
"add exposed internal faces to specified patch instead of to "
"'oldInternalFaces'"
);
#include "addOverwriteOption.H"
#include "addRegionOption.H"
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
Foam::word meshRegionName = polyMesh::defaultRegion;
args.optionReadIfPresent("region", meshRegionName);
word setName;
const bool useCellSet = args.optionReadIfPresent("cellSet", setName);
const bool useDict = args.optionFound("dict");
const bool overwrite = args.optionFound("overwrite");
if (!useCellSet && !useDict)
{
FatalErrorIn(args.executable())
<< "No cells to operate on selected. Please supply at least one of "
<< "'-cellSet', '-dict'"
<< exit(FatalError);
}
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();
const word setName = args[1];
const bool overwrite = args.optionFound("overwrite");
autoPtr<cellSet> currentSet;
if (useCellSet)
{
// Load the cellSet
Info<< "Operating on cell set " << setName << nl << endl;
currentSet.reset(new cellSet(mesh, setName));
}
PtrList<cellSelection> selectors;
if (useDict)
{
Info<< "Reading selection criteria from subsetMeshDict" << nl << endl;
IOdictionary dict
(
IOobject
(
"subsetMeshDict",
mesh.time().system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
const dictionary& selectionsDict = dict.subDict("selections");
label n = 0;
forAllConstIter(dictionary, selectionsDict, iter)
{
if (iter().isDict())
{
n++;
}
}
selectors.setSize(n);
n = 0;
forAllConstIter(dictionary, selectionsDict, iter)
{
if (iter().isDict())
{
selectors.set
(
n++,
cellSelection::New(iter().keyword(), mesh, iter().dict())
);
}
}
}
Info<< "Reading cell set from " << setName << endl << endl;
// Create mesh subsetting engine
fvMeshSubset subsetter(mesh);
@ -212,9 +279,54 @@ int main(int argc, char *argv[])
}
cellSet currentSet(mesh, setName);
// Select cells to operate on
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
boolList selectedCell(mesh.nCells(), false);
if (currentSet.valid())
{
const cellSet& set = currentSet();
forAllConstIter(cellSet, set, iter)
{
selectedCell[iter.key()] = true;
}
}
else
{
selectedCell = true;
}
// Manipulate selectedCell according to dictionary
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
forAll(selectors, i)
{
Info<< "Applying cellSelector " << selectors[i].name() << endl;
selectors[i].select(selectedCell);
Info<< "After applying cellSelector " << selectors[i].name()
<< " have " << cellSelection::count(selectedCell)
<< " cells" << nl << endl;
}
// Back from selectedCells to region
{
Info<< "Final selection : " << cellSelection::count(selectedCell)
<< " cells" << nl << endl;
labelList cellRegion(mesh.nCells(), -1);
forAll(selectedCell, cellI)
{
if (selectedCell[cellI])
{
cellRegion[cellI] = 0;
}
}
subsetter.setLargeCellSubset(cellRegion, 0, patchI, true);
}
subsetter.setLargeCellSubset(currentSet, patchI, true);
IOobjectList objects(mesh, runTime.timeName());

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object subsetMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Load snappyHexMeshDict settings so we can use some entries below.
#include "./snappyHexMeshDict"
selections
{
badQuality
{
// Remove any cells using a 'bad quality' face. Uses the mesh checks
// used by snappyHexMesh, cvMesh.
type badQuality;
// Use the quality criteria from the snappyHexMeshDict
${.meshQualityControls}
}
outside
{
// Remove any cells not reachable from provided locations
type outside;
//- Number of cell layers to erode mesh to detect holes in the mesh
// Set to 0 if not used.
nErodeLayers 3;
//- Define mesh location for keeping.
// In this case use the one from snappyHexMeshDict. This can
// optionally be a list of locations.
locationsInMesh (${.castellatedMeshControls.locationInMesh});
}
}
// ************************************************************************* //

View File

@ -1,15 +1,9 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/lagrangian/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/browser/lnInclude \
-I$(LIB_SRC)/foam/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude
EXE_LIBS = \

View File

@ -1,12 +1,12 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-lfileFormats \
-lgenericPatchFields \
-llagrangian

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude
@ -9,6 +10,7 @@ EXE_LIBS = \
-lfiniteVolume \
-lgenericPatchFields \
-lmeshTools \
-lfileFormats \
-lsampling \
-lsurfMesh \
-llagrangian

View File

@ -5,8 +5,7 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
$(FOAM_LIBBIN)/postCalc.o \

View File

@ -55,7 +55,7 @@ void calcIncompressibleYPlus
volScalarField& yPlus
)
{
typedef incompressible::RASModels::nutWallFunctionFvPatchScalarField
typedef incompressible::nutWallFunctionFvPatchScalarField
wallFunctionPatchField;
#include "createPhi.H"
@ -107,7 +107,7 @@ void calcCompressibleYPlus
volScalarField& yPlus
)
{
typedef compressible::RASModels::mutWallFunctionFvPatchScalarField
typedef compressible::mutWallFunctionFvPatchScalarField
wallFunctionPatchField;
IOobject rhoHeader

View File

@ -136,7 +136,7 @@ int main(int argc, char *argv[])
}
// Create G field - used by RAS wall functions
volScalarField G("RASModel.G", nut*2*sqr(S));
volScalarField G(turbulence().type() + ".G", nut*2*sqr(S));
//--- Read and modify turbulence fields

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -232,43 +232,42 @@ void updateCompressibleCase(const fvMesh& mesh)
(
mesh,
"mut",
compressible::RASModels::mutkWallFunctionFvPatchScalarField::typeName,
compressible::mutkWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"epsilon",
compressible::RASModels::epsilonWallFunctionFvPatchScalarField::
typeName,
compressible::epsilonWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"omega",
compressible::RASModels::omegaWallFunctionFvPatchScalarField::typeName,
compressible::omegaWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"k",
compressible::RASModels::kqRWallFunctionFvPatchField<scalar>::typeName,
compressible::kqRWallFunctionFvPatchField<scalar>::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"q",
compressible::RASModels::kqRWallFunctionFvPatchField<scalar>::typeName,
compressible::kqRWallFunctionFvPatchField<scalar>::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"R",
compressible::RASModels::kqRWallFunctionFvPatchField<symmTensor>::
compressible::kqRWallFunctionFvPatchField<symmTensor>::
typeName,
"(0 0 0 0 0 0)"
);
@ -284,14 +283,14 @@ void updateIncompressibleCase(const fvMesh& mesh)
(
mesh,
"nut",
incompressible::RASModels::nutkWallFunctionFvPatchScalarField::typeName,
incompressible::nutkWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"epsilon",
incompressible::RASModels::epsilonWallFunctionFvPatchScalarField::
incompressible::epsilonWallFunctionFvPatchScalarField::
typeName,
"0"
);
@ -299,7 +298,7 @@ void updateIncompressibleCase(const fvMesh& mesh)
(
mesh,
"omega",
incompressible::RASModels::omegaWallFunctionFvPatchScalarField::
incompressible::omegaWallFunctionFvPatchScalarField::
typeName,
"0"
);
@ -307,24 +306,21 @@ void updateIncompressibleCase(const fvMesh& mesh)
(
mesh,
"k",
incompressible::RASModels::kqRWallFunctionFvPatchField<scalar>::
typeName,
incompressible::kqRWallFunctionFvPatchField<scalar>::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"q",
incompressible::RASModels::kqRWallFunctionFvPatchField<scalar>::
typeName,
incompressible::kqRWallFunctionFvPatchField<scalar>::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"R",
incompressible::RASModels::kqRWallFunctionFvPatchField<symmTensor>::
typeName,
incompressible::kqRWallFunctionFvPatchField<symmTensor>::typeName,
"(0 0 0 0 0 0)"
);
}

View File

@ -1,10 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/randomProcesses/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lrandomProcesses \
-lsampling \
-lmeshTools \
-lfiniteVolume

View File

@ -359,9 +359,10 @@ public:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
#include "addRegionOption.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createNamedMesh.H"
Info<< "Reading setFieldsDict\n" << endl;

View File

@ -74,6 +74,7 @@ cleanCase()
cleanDynamicCode
rm -rf processor* > /dev/null 2>&1
rm -rf postProcessing > /dev/null 2>&1
rm -rf probes* > /dev/null 2>&1
rm -rf forces* > /dev/null 2>&1
rm -rf graphs* > /dev/null 2>&1

View File

@ -112,7 +112,7 @@ DebugSwitches
ConeInjection 0;
Constant 0;
ConstantRateDevolatilisation 0;
CrankNicholson 0;
CrankNicolson 0;
CrossPowerLaw 0;
Cs 0;
DIC 0;

View File

@ -245,6 +245,15 @@ template<class Container, class T, int nRows, int nColumns>
List<Container> initListList(const T[nRows][nColumns]);
//- Helper class for list to append y onto the end of x
template<class T>
class ListAppendEqOp
{
public:
void operator()(List<T>& x, const List<T>& y) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -684,4 +684,26 @@ Foam::List<Container> Foam::initListList(const T elems[nRows][nColumns])
}
template<class T>
void Foam::ListAppendEqOp<T>::operator()(List<T>& x, const List<T>& y) const
{
if (y.size())
{
if (x.size())
{
label sz = x.size();
x.setSize(sz + y.size());
forAll(y, i)
{
x[sz++] = y[i];
}
}
else
{
x = y;
}
}
}
// ************************************************************************* //

View File

@ -324,6 +324,7 @@ Foam::Time::Time
secondaryWriteControl_(wcTimeStep),
secondaryWriteInterval_(labelMax/10.0), // bit less to allow calculations
purgeWrite_(0),
secondaryPurgeWrite_(0),
writeOnce_(false),
subCycling_(false),
sigWriteNow_(true, *this),
@ -416,6 +417,7 @@ Foam::Time::Time
secondaryWriteControl_(wcTimeStep),
secondaryWriteInterval_(labelMax/10.0),
purgeWrite_(0),
secondaryPurgeWrite_(0),
writeOnce_(false),
subCycling_(false),
sigWriteNow_(true, *this),
@ -511,6 +513,7 @@ Foam::Time::Time
secondaryWriteControl_(wcTimeStep),
secondaryWriteInterval_(labelMax/10.0),
purgeWrite_(0),
secondaryPurgeWrite_(0),
writeOnce_(false),
subCycling_(false),
sigWriteNow_(true, *this),
@ -608,6 +611,7 @@ Foam::Time::Time
secondaryWriteControl_(wcTimeStep),
secondaryWriteInterval_(labelMax/10.0),
purgeWrite_(0),
secondaryPurgeWrite_(0),
writeOnce_(false),
subCycling_(false),
@ -1070,11 +1074,13 @@ Foam::Time& Foam::Time::operator++()
outputTime_ = false;
primaryOutputTime_ = false;
secondaryOutputTime_ = false;
switch (writeControl_)
{
case wcTimeStep:
outputTime_ = !(timeIndex_ % label(writeInterval_));
primaryOutputTime_ = !(timeIndex_ % label(writeInterval_));
break;
case wcRunTime:
@ -1088,7 +1094,7 @@ Foam::Time& Foam::Time::operator++()
if (outputIndex > outputTimeIndex_)
{
outputTime_ = true;
primaryOutputTime_ = true;
outputTimeIndex_ = outputIndex;
}
}
@ -1103,7 +1109,7 @@ Foam::Time& Foam::Time::operator++()
);
if (outputIndex > outputTimeIndex_)
{
outputTime_ = true;
primaryOutputTime_ = true;
outputTimeIndex_ = outputIndex;
}
}
@ -1118,7 +1124,7 @@ Foam::Time& Foam::Time::operator++()
);
if (outputIndex > outputTimeIndex_)
{
outputTime_ = true;
primaryOutputTime_ = true;
outputTimeIndex_ = outputIndex;
}
}
@ -1130,9 +1136,8 @@ Foam::Time& Foam::Time::operator++()
switch (secondaryWriteControl_)
{
case wcTimeStep:
outputTime_ =
outputTime_
|| !(timeIndex_ % label(secondaryWriteInterval_));
secondaryOutputTime_ =
!(timeIndex_ % label(secondaryWriteInterval_));
break;
case wcRunTime:
@ -1146,7 +1151,7 @@ Foam::Time& Foam::Time::operator++()
if (outputIndex > secondaryOutputTimeIndex_)
{
outputTime_ = true;
secondaryOutputTime_ = true;
secondaryOutputTimeIndex_ = outputIndex;
}
}
@ -1161,7 +1166,7 @@ Foam::Time& Foam::Time::operator++()
);
if (outputIndex > secondaryOutputTimeIndex_)
{
outputTime_ = true;
secondaryOutputTime_ = true;
secondaryOutputTimeIndex_ = outputIndex;
}
}
@ -1176,7 +1181,7 @@ Foam::Time& Foam::Time::operator++()
);
if (outputIndex > secondaryOutputTimeIndex_)
{
outputTime_ = true;
secondaryOutputTime_ = true;
secondaryOutputTimeIndex_ = outputIndex;
}
}
@ -1184,6 +1189,9 @@ Foam::Time& Foam::Time::operator++()
}
outputTime_ = primaryOutputTime_ || secondaryOutputTime_;
// see if endTime needs adjustment to stop at the next run()/end() check
if (!end())
{
@ -1195,6 +1203,7 @@ Foam::Time& Foam::Time::operator++()
{
endTime_ = value();
outputTime_ = true;
primaryOutputTime_ = true;
}
else if (stopAt_ == saNextWrite && outputTime_ == true)
{
@ -1205,6 +1214,7 @@ Foam::Time& Foam::Time::operator++()
// Override outputTime if one-shot writing
if (writeOnce_)
{
primaryOutputTime_ = true;
outputTime_ = true;
writeOnce_ = false;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -138,10 +138,15 @@ protected:
scalar secondaryWriteInterval_;
label purgeWrite_;
mutable FIFOStack<word> previousOutputTimes_;
// Additional purging
label secondaryPurgeWrite_;
mutable FIFOStack<word> previousSecondaryOutputTimes_;
// One-shot writing
bool writeOnce_;

View File

@ -160,6 +160,20 @@ void Foam::Time::readDict()
}
}
if (controlDict_.readIfPresent("secondaryPurgeWrite", secondaryPurgeWrite_))
{
if (secondaryPurgeWrite_ < 0)
{
WarningIn("Time::readDict()")
<< "invalid value for secondaryPurgeWrite "
<< secondaryPurgeWrite_
<< ", should be >= 0, setting to 0"
<< endl;
secondaryPurgeWrite_ = 0;
}
}
if (controlDict_.found("timeFormat"))
{
const word formatName(controlDict_.lookup("timeFormat"));
@ -347,13 +361,45 @@ bool Foam::Time::writeObject
timeDict.regIOobject::writeObject(fmt, ver, cmp);
bool writeOK = objectRegistry::writeObject(fmt, ver, cmp);
if (writeOK && purgeWrite_)
if (writeOK)
{
previousOutputTimes_.push(tmName);
while (previousOutputTimes_.size() > purgeWrite_)
// Does primary or secondary time trigger purging?
// Note that primary times can only be purged by primary
// purging. Secondary times can be purged by either primary
// or secondary purging.
if (primaryOutputTime_ && purgeWrite_)
{
rmDir(objectRegistry::path(previousOutputTimes_.pop()));
previousOutputTimes_.push(tmName);
while (previousOutputTimes_.size() > purgeWrite_)
{
rmDir(objectRegistry::path(previousOutputTimes_.pop()));
}
}
if
(
!primaryOutputTime_
&& secondaryOutputTime_
&& secondaryPurgeWrite_
)
{
// Writing due to secondary
previousSecondaryOutputTimes_.push(tmName);
while
(
previousSecondaryOutputTimes_.size()
> secondaryPurgeWrite_
)
{
rmDir
(
objectRegistry::path
(
previousSecondaryOutputTimes_.pop()
)
);
}
}
}
@ -368,6 +414,7 @@ bool Foam::Time::writeObject
bool Foam::Time::writeNow()
{
primaryOutputTime_ = true;
outputTime_ = true;
return write();
}

View File

@ -37,7 +37,9 @@ Foam::TimeState::TimeState()
deltaT0_(0),
deltaTchanged_(false),
outputTimeIndex_(0),
primaryOutputTime_(false),
secondaryOutputTimeIndex_(0),
secondaryOutputTime_(false),
outputTime_(false)
{}

View File

@ -61,8 +61,14 @@ protected:
bool deltaTchanged_;
label outputTimeIndex_;
//- Is outputTime because of primary?
bool primaryOutputTime_;
label secondaryOutputTimeIndex_;
bool outputTime_;
//- Is outputTime because of secondary?
bool secondaryOutputTime_;
bool outputTime_;
public:
@ -112,7 +118,7 @@ public:
// Check
//- Return true if this is an output time
//- Return true if this is an output time (primary or secondary)
bool outputTime() const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -132,15 +132,30 @@ Foam::word Foam::Time::findInstance
|| rOpt == IOobject::MUST_READ_IF_MODIFIED
)
{
FatalErrorIn
(
"Time::findInstance"
"(const fileName&, const word&"
", const IOobject::readOption, const word&)"
) << "Cannot find file \"" << name << "\" in directory "
<< dir << " in times " << timeName()
<< " down to " << stopInstance
<< exit(FatalError);
if (name.empty())
{
FatalErrorIn
(
"Time::findInstance"
"(const fileName&, const word&"
", const IOobject::readOption, const word&)"
) << "Cannot find directory "
<< dir << " in times " << timeName()
<< " down to " << stopInstance
<< exit(FatalError);
}
else
{
FatalErrorIn
(
"Time::findInstance"
"(const fileName&, const word&"
", const IOobject::readOption, const word&)"
) << "Cannot find file \"" << name << "\" in directory "
<< dir << " in times " << timeName()
<< " down to " << stopInstance
<< exit(FatalError);
}
}
return ts[instanceI].name();

View File

@ -168,7 +168,7 @@ Foam::functionObjectFile::functionObjectFile
names_.insert(name);
filePtrs_.clear();
filePtrs_.setSize(names_.toc().size());
filePtrs_.setSize(1);
// cannot create files - need to access virtual function
}
@ -193,7 +193,7 @@ Foam::functionObjectFile::functionObjectFile
names_.insert(names);
filePtrs_.clear();
filePtrs_.setSize(names_.toc().size());
filePtrs_.setSize(names_.size());
// cannot create files - need to access virtual function
}

View File

@ -64,7 +64,7 @@ private:
const objectRegistry& obr_;
//- Prefix
const word& prefix_;
const word prefix_;
//- File names
wordHashSet names_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,11 +30,8 @@ License
namespace Foam
{
template<>
const char* Foam::NamedEnum
<
Foam::outputFilterOutputControl::outputControls,
2
>::names[] =
const char* NamedEnum<outputFilterOutputControl::outputControls, 2>::
names[] =
{
"timeStep",
"outputTime"

View File

@ -28,227 +28,27 @@ License
#include "globalMeshData.H"
#include "cyclicPolyPatch.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
void Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
readField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const word& patchFieldType
)
:
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{
if (debug)
{
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField(const BoundaryMesh&, "
"const Field<Type>&, const word&)"
<< endl;
}
forAll(bmesh_, patchi)
{
this->set
(
patchi,
PatchField<Type>::New
(
patchFieldType,
bmesh_[patchi],
field
)
);
}
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const wordList& patchFieldTypes,
const wordList& constraintTypes
)
:
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{
if (debug)
{
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField(const BoundaryMesh&, "
"const Field<Type>&, const wordList&, const wordList&)"
<< endl;
}
if
(
patchFieldTypes.size() != this->size()
|| (constraintTypes.size() && (constraintTypes.size() != this->size()))
)
{
FatalErrorIn
(
"GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField(const BoundaryMesh&, "
"const Field<Type>&, const wordList&, const wordList&)"
) << "Incorrect number of patch type specifications given" << nl
<< " Number of patches in mesh = " << bmesh.size()
<< " number of patch type specifications = "
<< patchFieldTypes.size()
<< abort(FatalError);
}
if (constraintTypes.size())
{
forAll(bmesh_, patchi)
{
this->set
(
patchi,
PatchField<Type>::New
(
patchFieldTypes[patchi],
constraintTypes[patchi],
bmesh_[patchi],
field
)
);
}
}
else
{
forAll(bmesh_, patchi)
{
this->set
(
patchi,
PatchField<Type>::New
(
patchFieldTypes[patchi],
bmesh_[patchi],
field
)
);
}
}
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const PtrList<PatchField<Type> >& ptfl
)
:
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{
if (debug)
{
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField(const BoundaryMesh&, "
"const Field<Type>&, const PatchField<Type>List&)"
<< endl;
}
forAll(bmesh_, patchi)
{
this->set(patchi, ptfl[patchi].clone(field));
}
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const DimensionedField<Type, GeoMesh>& field,
const typename GeometricField<Type, PatchField, GeoMesh>::
GeometricBoundaryField& btf
)
:
FieldField<PatchField, Type>(btf.size()),
bmesh_(btf.bmesh_)
{
if (debug)
{
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField(const GeometricBoundaryField<Type, "
"PatchField, BoundaryMesh>&)"
<< endl;
}
forAll(bmesh_, patchi)
{
this->set(patchi, btf[patchi].clone(field));
}
}
// Construct as copy
// Dangerous because Field may be set to a field which gets deleted.
// Need new type of GeometricBoundaryField, one which IS part of a geometric
// field for which snGrad etc. may be called and a free standing
// GeometricBoundaryField for which such operations are unavailable.
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const typename GeometricField<Type, PatchField, GeoMesh>::
GeometricBoundaryField& btf
)
:
FieldField<PatchField, Type>(btf),
bmesh_(btf.bmesh_)
{
if (debug)
{
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField(const GeometricBoundaryField<Type, "
"PatchField, BoundaryMesh>&)"
<< endl;
}
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const dictionary& dict
)
:
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{
this->setSize(bmesh_.size());
if (debug)
{
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField"
"(const BoundaryMesh&, const Field<Type>&, const dictionary&)"
"GeometricBoundaryField::readField"
"("
"const DimensionedField<Type, GeoMesh>&, "
"const dictionary&"
")"
<< endl;
}
// Patch or patch-groups. (using non-wild card entries of dictionaries)
forAllConstIter(dictionary, dict, iter)
{
@ -263,6 +63,7 @@ GeometricBoundaryField
forAll(patchIDs, i)
{
label patchi = patchIDs[i];
this->set
(
patchi,
@ -326,12 +127,11 @@ GeometricBoundaryField
{
FatalIOErrorIn
(
"GeometricField<Type, PatchField, GeoMesh>::\n"
"GeometricBoundaryField::GeometricBoundaryField\n"
"(\n"
" const BoundaryMesh&,\n"
" const DimensionedField<Type, GeoMesh>&,\n"
" const dictionary&\n"
"GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::readField"
"("
"const DimensionedField<Type, GeoMesh>&, "
"const dictionary&"
")",
dict
) << "Cannot find patchField entry for cyclic "
@ -344,12 +144,11 @@ GeometricBoundaryField
{
FatalIOErrorIn
(
"GeometricField<Type, PatchField, GeoMesh>::\n"
"GeometricBoundaryField::GeometricBoundaryField\n"
"(\n"
" const BoundaryMesh&,\n"
" const DimensionedField<Type, GeoMesh>&,\n"
" const dictionary&\n"
"GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::readField"
"("
"const DimensionedField<Type, GeoMesh>&, "
"const dictionary&"
")",
dict
) << "Cannot find patchField entry for "
@ -360,6 +159,254 @@ GeometricBoundaryField
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const BoundaryMesh& bmesh
)
:
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const word& patchFieldType
)
:
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{
if (debug)
{
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField(const BoundaryMesh&, "
"const DimensionedField<Type>&, const word&)"
<< endl;
}
forAll(bmesh_, patchi)
{
this->set
(
patchi,
PatchField<Type>::New
(
patchFieldType,
bmesh_[patchi],
field
)
);
}
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const wordList& patchFieldTypes,
const wordList& constraintTypes
)
:
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{
if (debug)
{
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField"
"("
"const BoundaryMesh&, "
"const DimensionedField<Type>&, "
"const wordList&, "
"const wordList&"
")"
<< endl;
}
if
(
patchFieldTypes.size() != this->size()
|| (constraintTypes.size() && (constraintTypes.size() != this->size()))
)
{
FatalErrorIn
(
"GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField"
"("
"const BoundaryMesh&, "
"const DimensionedField<Type>&, "
"const wordList&, "
"const wordList&"
")"
) << "Incorrect number of patch type specifications given" << nl
<< " Number of patches in mesh = " << bmesh.size()
<< " number of patch type specifications = "
<< patchFieldTypes.size()
<< abort(FatalError);
}
if (constraintTypes.size())
{
forAll(bmesh_, patchi)
{
this->set
(
patchi,
PatchField<Type>::New
(
patchFieldTypes[patchi],
constraintTypes[patchi],
bmesh_[patchi],
field
)
);
}
}
else
{
forAll(bmesh_, patchi)
{
this->set
(
patchi,
PatchField<Type>::New
(
patchFieldTypes[patchi],
bmesh_[patchi],
field
)
);
}
}
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const PtrList<PatchField<Type> >& ptfl
)
:
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{
if (debug)
{
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField"
"("
"const BoundaryMesh&, "
"const DimensionedField<Type, GeoMesh>&, "
"const PtrLIst<PatchField<Type> >&"
")"
<< endl;
}
forAll(bmesh_, patchi)
{
this->set(patchi, ptfl[patchi].clone(field));
}
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const DimensionedField<Type, GeoMesh>& field,
const typename GeometricField<Type, PatchField, GeoMesh>::
GeometricBoundaryField& btf
)
:
FieldField<PatchField, Type>(btf.size()),
bmesh_(btf.bmesh_)
{
if (debug)
{
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField"
"("
"const DimensionedField<Type, GeoMesh>&, "
"const typename GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField&"
")"
<< endl;
}
forAll(bmesh_, patchi)
{
this->set(patchi, btf[patchi].clone(field));
}
}
// Construct as copy
// Dangerous because Field may be set to a field which gets deleted.
// Need new type of GeometricBoundaryField, one which IS part of a geometric
// field for which snGrad etc. may be called and a free standing
// GeometricBoundaryField for which such operations are unavailable.
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const typename GeometricField<Type, PatchField, GeoMesh>::
GeometricBoundaryField& btf
)
:
FieldField<PatchField, Type>(btf),
bmesh_(btf.bmesh_)
{
if (debug)
{
Info<< "GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField::"
"GeometricBoundaryField"
"("
"const GeometricField<Type, PatchField, GeoMesh>::"
"GeometricBoundaryField&"
")"
<< endl;
}
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::
GeometricBoundaryField
(
const BoundaryMesh& bmesh,
const DimensionedField<Type, GeoMesh>& field,
const dictionary& dict
)
:
FieldField<PatchField, Type>(bmesh.size()),
bmesh_(bmesh)
{
readField(field, dict);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type, template<class> class PatchField, class GeoMesh>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,70 +47,49 @@ if ((gf1).mesh() != (gf2).mesh()) \
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::tmp
<
typename Foam::GeometricField<Type, PatchField, GeoMesh>::
GeometricBoundaryField
>
Foam::GeometricField<Type, PatchField, GeoMesh>::readField
void Foam::GeometricField<Type, PatchField, GeoMesh>::readFields
(
const dictionary& fieldDict
const dictionary& dict
)
{
DimensionedField<Type, GeoMesh>::readField(fieldDict, "internalField");
DimensionedField<Type, GeoMesh>::readField(dict, "internalField");
tmp<GeometricBoundaryField> tboundaryField
(
new GeometricBoundaryField
(
this->mesh().boundary(),
*this,
fieldDict.subDict("boundaryField")
)
);
boundaryField_.readField(*this, dict.subDict("boundaryField"));
if (fieldDict.found("referenceLevel"))
if (dict.found("referenceLevel"))
{
Type fieldAverage(pTraits<Type>(fieldDict.lookup("referenceLevel")));
Type fieldAverage(pTraits<Type>(dict.lookup("referenceLevel")));
Field<Type>::operator+=(fieldAverage);
GeometricBoundaryField& boundaryField = tboundaryField();
forAll(boundaryField, patchi)
forAll(boundaryField_, patchi)
{
boundaryField[patchi] == boundaryField[patchi] + fieldAverage;
boundaryField_[patchi] == boundaryField_[patchi] + fieldAverage;
}
}
return tboundaryField;
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::tmp
<
typename Foam::GeometricField<Type, PatchField, GeoMesh>::
GeometricBoundaryField
>
Foam::GeometricField<Type, PatchField, GeoMesh>::readField(Istream& is)
void Foam::GeometricField<Type, PatchField, GeoMesh>::readFields()
{
return readField
const IOdictionary dict
(
IOdictionary
IOobject
(
IOobject
(
this->name(),
this->time().timeName(),
this->db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
is
)
this->name(),
this->time().timeName(),
this->db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->readStream(typeName)
);
this->close();
readFields(dict);
}
@ -132,8 +111,7 @@ bool Foam::GeometricField<Type, PatchField, GeoMesh>::readIfPresent()
}
else if (this->readOpt() == IOobject::READ_IF_PRESENT && this->headerOk())
{
boundaryField_.transfer(readField(this->readStream(typeName))());
this->close();
readFields();
// Check compatibility between field and mesh
if (this->size() != GeoMesh::size(this->mesh()))
@ -360,9 +338,9 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
boundaryField_(*this, readField(this->readStream(typeName)))
boundaryField_(mesh.boundary())
{
this->close();
readFields();
// Check compatibility between field and mesh
@ -401,8 +379,10 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
boundaryField_(*this, readField(dict))
boundaryField_(mesh.boundary())
{
readFields(dict);
// Check compatibility between field and mesh
if (this->size() != GeoMesh::size(this->mesh()))

View File

@ -117,6 +117,9 @@ public:
// Constructors
//- Construct from a BoundaryMesh
GeometricBoundaryField(const BoundaryMesh&);
//- Construct from a BoundaryMesh,
// reference to the internal field
// and a patch type
@ -177,6 +180,13 @@ public:
// Member functions
//- Read the boundary field
void readField
(
const DimensionedField<Type, GeoMesh>& field,
const dictionary& dict
);
//- Update the boundary condition coefficients
void updateCoeffs();
@ -247,10 +257,10 @@ private:
// Private Member Functions
//- Read the field from the dictionary
tmp<GeometricBoundaryField> readField(const dictionary&);
void readFields(const dictionary&);
//- Read the field from the given stream
tmp<GeometricBoundaryField> readField(Istream& is);
//- Read the field - create the field dictionary on-the-fly
void readFields();
public:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -481,6 +481,15 @@ public:
);
}
//- Swap to obtain neighbour cell values for all boundary faces
template <class T>
static void swapBoundaryCellList
(
const polyMesh& mesh,
const UList<T>& cellData,
List<T>& neighbourCellData
);
// Sparse versions
//- Synchronize values on selected points.

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -1553,6 +1553,45 @@ void Foam::syncTools::syncFaceList
}
template <class T>
void Foam::syncTools::swapBoundaryCellList
(
const polyMesh& mesh,
const UList<T>& cellData,
List<T>& neighbourCellData
)
{
if (cellData.size() != mesh.nCells())
{
FatalErrorIn
(
"syncTools<class T>::swapBoundaryCellList"
"(const polyMesh&, const UList<T>&, List<T>&)"
) << "Number of cell values " << cellData.size()
<< " is not equal to the number of cells in the mesh "
<< mesh.nCells() << abort(FatalError);
}
const polyBoundaryMesh& patches = mesh.boundaryMesh();
label nBnd = mesh.nFaces()-mesh.nInternalFaces();
neighbourCellData.setSize(nBnd);
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
const labelUList& faceCells = pp.faceCells();
forAll(faceCells, i)
{
label bFaceI = pp.start()+i-mesh.nInternalFaces();
neighbourCellData[bFaceI] = cellData[faceCells[i]];
}
}
syncTools::swapBoundaryFaceList(mesh, neighbourCellData);
}
template <unsigned nBits>
void Foam::syncTools::swapFaceList
(

View File

@ -90,40 +90,68 @@ EqOp(nopEq, (void)x)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define Op(opName, op) \
\
template<class T, class T1, class T2> \
class opName##Op3 \
{ \
public: \
\
T operator()(const T1& x, const T2& y) const \
{ \
return op; \
} \
}; \
\
template<class T1, class T2> \
class opName##Op2 \
{ \
public: \
\
T1 operator()(const T1& x, const T2& y) const \
{ \
return op; \
} \
}; \
\
template<class T> \
class opName##Op \
{ \
public: \
\
T operator()(const T& x, const T& y) const \
{ \
return op; \
} \
};
#define Op(opName, op) \
\
template<class T, class T1, class T2> \
class opName##Op3 \
{ \
public: \
\
T operator()(const T1& x, const T2& y) const \
{ \
return op; \
} \
}; \
\
template<class T1, class T2> \
class opName##Op2 \
{ \
public: \
\
T1 operator()(const T1& x, const T2& y) const \
{ \
return op; \
} \
}; \
\
template<class T> \
class opName##Op \
{ \
public: \
\
T operator()(const T& x, const T& y) const \
{ \
return op; \
} \
};
#define weightedOp(opName, op) \
\
template<class Type, class CombineOp> \
class opName##WeightedOp \
{ \
const CombineOp& cop_; \
\
public: \
\
opName##WeightedOp(const CombineOp& cop) \
: \
cop_(cop) \
{} \
\
void operator() \
( \
Type& x, \
const label index, \
const Type& y, \
const scalar weight \
) const \
{ \
cop_(x, op); \
} \
}; \
Op(sum, x + y)
@ -147,6 +175,8 @@ Op(lessEq, x <= y)
Op(greater, x > y)
Op(greaterEq, x >= y)
weightedOp(multiply, weight * y)
#undef Op

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -104,6 +104,8 @@ bool Foam::motionSmoother::checkMesh
(
readScalar(dict.lookup("minTriangleTwist", true))
);
scalar minFaceFlatness = -1.0;
dict.readIfPresent("minFaceFlatness", minFaceFlatness, true);
const scalar minDet
(
readScalar(dict.lookup("minDeterminant", true))
@ -356,6 +358,30 @@ bool Foam::motionSmoother::checkMesh
nWrongFaces = nNewWrongFaces;
}
if (minFaceFlatness > -SMALL)
{
polyMeshGeometry::checkFaceFlatness
(
report,
minFaceFlatness,
mesh,
mesh.faceAreas(),
mesh.faceCentres(),
mesh.points(),
checkFaces,
&wrongFaces
);
label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
Info<< " faces with flatness < "
<< setw(5) << minFaceFlatness
<< " : "
<< nNewWrongFaces-nWrongFaces << endl;
nWrongFaces = nNewWrongFaces;
}
if (minDet > -1)
{
polyMeshGeometry::checkCellDeterminant
@ -479,6 +505,8 @@ bool Foam::motionSmoother::checkMesh
(
readScalar(dict.lookup("minTriangleTwist", true))
);
scalar minFaceFlatness = -1.0;
dict.readIfPresent("minFaceFlatness", minFaceFlatness, true);
const scalar minDet
(
readScalar(dict.lookup("minDeterminant", true))
@ -697,6 +725,27 @@ bool Foam::motionSmoother::checkMesh
nWrongFaces = nNewWrongFaces;
}
if (minFaceFlatness > -1)
{
meshGeom.checkFaceFlatness
(
report,
minFaceFlatness,
meshGeom.mesh().points(),
checkFaces,
&wrongFaces
);
label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
Info<< " faces with flatness < "
<< setw(5) << minFaceFlatness
<< " : "
<< nNewWrongFaces-nWrongFaces << endl;
nWrongFaces = nNewWrongFaces;
}
if (minDet > -1)
{
meshGeom.checkCellDeterminant

View File

@ -341,8 +341,8 @@ bool Foam::polyMeshGeometry::checkFaceTet
{
Pout<< "bool polyMeshGeometry::checkFaceTets("
<< "const bool, const scalar, const pointField&"
<< ", const pointField&, const labelList&,"
<< " labelHashSet*): "
<< ", const pointField&"
<< ", const labelList&, labelHashSet*) : "
<< "face " << faceI
<< " has a triangle that points the wrong way."
<< endl
@ -373,9 +373,6 @@ Foam::polyMeshGeometry::polyMeshGeometry(const polyMesh& mesh)
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
//- Take over properties from mesh
@ -2014,6 +2011,113 @@ bool Foam::polyMeshGeometry::checkTriangleTwist
}
bool Foam::polyMeshGeometry::checkFaceFlatness
(
const bool report,
const scalar minFlatness,
const polyMesh& mesh,
const vectorField& faceAreas,
const vectorField& faceCentres,
const pointField& p,
const labelList& checkFaces,
labelHashSet* setPtr
)
{
if (minFlatness < -SMALL || minFlatness > 1+SMALL)
{
FatalErrorIn
(
"polyMeshGeometry::checkFaceFlatness"
"(const bool, const scalar, const polyMesh&, const pointField&"
", const pointField&, const labelList&, labelHashSet*)"
) << "minFlatness should be [0..1] but is now " << minFlatness
<< abort(FatalError);
}
const faceList& fcs = mesh.faces();
label nWarped = 0;
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
const face& f = fcs[faceI];
if (f.size() > 3)
{
const point& fc = faceCentres[faceI];
// Sum triangle areas
scalar sumArea = 0.0;
forAll(f, fp)
{
sumArea += triPointRef
(
p[f[fp]],
p[f.nextLabel(fp)],
fc
).mag();
}
if (sumArea/mag(faceAreas[faceI]) < minFlatness)
{
nWarped++;
if (setPtr)
{
setPtr->insert(faceI);
}
}
}
}
reduce(nWarped, sumOp<label>());
if (report)
{
if (nWarped> 0)
{
Info<< "There are " << nWarped
<< " faces with area of invidual triangles"
<< " compared to overall area less than "
<< minFlatness << nl << endl;
}
else
{
Info<< "All faces are flat in that the area of invidual triangles"
<< " compared to overall area is less than "
<< minFlatness << nl << endl;
}
}
if (nWarped > 0)
{
if (report)
{
WarningIn
(
"polyMeshGeometry::checkFaceFlatness"
"(const bool, const scalar, const polyMesh&"
", const pointField&, const pointField&, const labelList&"
", labelHashSet*)"
) << nWarped << " non-flat faces "
<< "(area of invidual triangles"
<< " compared to overall area"
<< " < " << minFlatness << ") found.\n"
<< endl;
}
return true;
}
else
{
return false;
}
}
bool Foam::polyMeshGeometry::checkFaceArea
(
const bool report,
@ -2398,6 +2502,29 @@ bool Foam::polyMeshGeometry::checkTriangleTwist
}
bool Foam::polyMeshGeometry::checkFaceFlatness
(
const bool report,
const scalar minFlatness,
const pointField& p,
const labelList& checkFaces,
labelHashSet* setPtr
) const
{
return checkFaceFlatness
(
report,
minFlatness,
mesh_,
faceAreas_,
faceCentres_,
p,
checkFaces,
setPtr
);
}
bool Foam::polyMeshGeometry::checkFaceArea
(
const bool report,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -303,6 +303,19 @@ public:
labelHashSet* setPtr
);
//- Area of faces v.s. sum of triangle areas
static bool checkFaceFlatness
(
const bool report,
const scalar minFlatness,
const polyMesh&,
const vectorField& faceAreas,
const vectorField& faceCentres,
const pointField& p,
const labelList& checkFaces,
labelHashSet* setPtr
);
//- Small faces
static bool checkFaceArea
(
@ -314,6 +327,7 @@ public:
labelHashSet* setPtr
);
//- Area of internal faces v.s. boundary faces
static bool checkCellDeterminant
(
const bool report,
@ -413,6 +427,15 @@ public:
labelHashSet* setPtr
) const;
bool checkFaceFlatness
(
const bool report,
const scalar minFlatness,
const pointField& p,
const labelList& checkFaces,
labelHashSet* setPtr
) const;
bool checkFaceArea
(
const bool report,

View File

@ -2,12 +2,10 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/fvMotionSolver/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
-I$(LIB_SRC)/fvMotionSolver/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-lmeshTools \
-ldynamicMesh \
-lfvMotionSolvers \
-lsampling
-lfvMotionSolvers

View File

@ -41,8 +41,18 @@ namespace Foam
fixedTemperatureSource,
dictionary
);
template<>
const char* NamedEnum<fixedTemperatureSource::temperatureMode, 2>::names[] =
{
"uniform",
"lookup"
};
}
const Foam::NamedEnum<Foam::fixedTemperatureSource::temperatureMode, 2>
Foam::fixedTemperatureSource::temperatureModeNames_;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -55,8 +65,32 @@ Foam::fixedTemperatureSource::fixedTemperatureSource
)
:
basicSource(name, modelType, dict, mesh),
T_(readScalar(coeffs_.lookup("temperature")))
mode_(temperatureModeNames_.read(coeffs_.lookup("mode"))),
Tuniform_(NULL),
TName_("T")
{
switch (mode_)
{
case tmUniform:
{
Tuniform_.reset
(
DataEntry<scalar>::New("temperature", coeffs_).ptr()
);
break;
}
case tmLookup:
{
TName_ = coeffs_.lookupOrDefault<word>("TName", "T");
break;
}
default:
{
// error handling done by NamedEnum
}
}
fieldNames_.setSize(1, "energy");
applied_.setSize(1, false);
}
@ -81,8 +115,32 @@ void Foam::fixedTemperatureSource::setValue
if (eqn.psi().name() == thermo.he().name())
{
const scalarField Tfield(cells_.size(), T_);
eqn.setValues(cells_, thermo.he(thermo.p(), Tfield, cells_));
switch (mode_)
{
case tmUniform:
{
const scalar t = mesh_.time().value();
scalarField Tuni(cells_.size(), Tuniform_->value(t));
eqn.setValues(cells_, thermo.he(thermo.p(), Tuni, cells_));
break;
}
case tmLookup:
{
const volScalarField& T =
mesh().lookupObject<volScalarField>(TName_);
scalarField Tlkp(T, cells_);
eqn.setValues(cells_, thermo.he(thermo.p(), Tlkp, cells_));
break;
}
default:
{
// error handling done by NamedEnum
}
}
}
}
@ -98,7 +156,15 @@ bool Foam::fixedTemperatureSource::read(const dictionary& dict)
{
if (basicSource::read(dict))
{
coeffs_.readIfPresent("T", T_);
if (coeffs_.found(Tuniform_->name()))
{
Tuniform_.reset
(
DataEntry<scalar>::New(Tuniform_->name(), dict).ptr()
);
}
coeffs_.readIfPresent("TName", TName_);
return true;
}

View File

@ -33,9 +33,18 @@ Description
fixedTemperatureSourceCoeffs
{
fieldNames (h e hs); // names of fields to apply source
temperature 500; // fixed temperature [K]
mode uniform; // constant or lookup
// uniform option
temperature constant 500; // fixed temperature [K]
// loolup option
// TName T; // optional temperature field name
}
Note:
The 'uniform' option allows the use of a time-varying uniform temperature
by means of the DataEntry type.
SourceFiles
basicSource.C
@ -46,6 +55,8 @@ SourceFiles
#define fixedTemperatureSource_H
#include "basicSource.H"
#include "NamedEnum.H"
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -61,12 +72,32 @@ class fixedTemperatureSource
public basicSource
{
public:
//- Temperature mode
enum temperatureMode
{
tmUniform,
tmLookup
};
//- String representation of temperatureMode enums
static const NamedEnum<temperatureMode, 2> temperatureModeNames_;
protected:
// Protected data
//- Fixed temperature [K]
scalar T_;
//- Operation mode
temperatureMode mode_;
//- Uniform temperature [K]
autoPtr<DataEntry<scalar> > Tuniform_;
//- Temperature field name
word TName_;
private:

View File

@ -81,9 +81,7 @@ void Foam::ExplicitSetValue<Type>::setValue
<< ">::setValue for source " << name_ << endl;
}
List<Type> values(cells_.size());
UIndirectList<Type>(values, cells_) = injectionRate_[fieldI];
List<Type> values(cells_.size(), injectionRate_[fieldI]);
eqn.setValues(cells_, values);
}

View File

@ -2,4 +2,17 @@ vtk/vtkUnstructuredReader.C
nas/NASCore.C
starcd/STARCDCore.C
coordSet/coordSet.C
setWriters = sampledSetWriters
$(setWriters)/writers.C
$(setWriters)/ensight/ensightSetWriterRunTime.C
$(setWriters)/gnuplot/gnuplotSetWriterRunTime.C
$(setWriters)/jplot/jplotSetWriterRunTime.C
$(setWriters)/raw/rawSetWriterRunTime.C
$(setWriters)/vtk/vtkSetWriterRunTime.C
$(setWriters)/xmgrace/xmgraceSetWriterRunTime.C
$(setWriters)/csv/csvSetWriterRunTime.C
LIB = $(FOAM_LIBBIN)/libfileFormats

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "gnuplotSetWriter.H"
#include "clock.H"
#include "coordSet.H"
#include "fileName.H"
#include "OFstream.H"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -166,7 +166,6 @@ void Foam::writer<Type>::write
{
valueSetPtrs[i] = &valueSets[i];
}
write(points, valueSetNames, valueSetPtrs, os);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -311,7 +311,7 @@ $(ddtSchemes)/localEulerDdtScheme/localEulerDdtSchemes.C
$(ddtSchemes)/backwardDdtScheme/backwardDdtSchemes.C
$(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C
$(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtSchemes.C
$(ddtSchemes)/CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C
$(ddtSchemes)/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C
$(ddtSchemes)/boundedDdtScheme/boundedDdtSchemes.C
d2dt2Schemes = finiteVolume/d2dt2Schemes

View File

@ -39,7 +39,7 @@ Foam::MRFZoneList::MRFZoneList
{
reset(dict);
active();
active(true);
}
@ -51,7 +51,7 @@ Foam::MRFZoneList::~MRFZoneList()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::MRFZoneList::active() const
bool Foam::MRFZoneList::active(const bool warn) const
{
bool a = false;
forAll(*this, i)
@ -59,7 +59,7 @@ bool Foam::MRFZoneList::active() const
a = a || this->operator[](i).active();
}
if (!a)
if (warn && this->size() && !a)
{
Info<< " No MRF zones active" << endl;
}

View File

@ -88,7 +88,7 @@ public:
// Member Functions
//- Return active status
bool active() const;
bool active(const bool warn = false) const;
//- Reset the source list
void reset(const dictionary& dict);

View File

@ -38,6 +38,8 @@ Foam::porosityModelList::porosityModelList
mesh_(mesh)
{
reset(dict);
active(true);
}
@ -49,7 +51,7 @@ Foam::porosityModelList::~porosityModelList()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::porosityModelList::active() const
bool Foam::porosityModelList::active(const bool warn) const
{
bool a = false;
forAll(*this, i)
@ -57,7 +59,7 @@ bool Foam::porosityModelList::active() const
a = a || this->operator[](i).active();
}
if (!a)
if (warn && this->size() && !a)
{
Info<< "No porosity models active" << endl;
}

View File

@ -88,7 +88,7 @@ public:
// Member Functions
//- Return active status
bool active() const;
bool active(const bool active = false) const;
//- Reset the source list
void reset(const dictionary& dict);

Some files were not shown because too many files have changed in this diff Show More