Merge branch 'master' into cvm

This commit is contained in:
graham
2009-07-28 10:40:50 +01:00
2023 changed files with 13229 additions and 15894 deletions

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Hex 2x2x2 refiner
Refines a hex mesh by 2x2x2 cell splitting.
\*---------------------------------------------------------------------------*/

View File

@ -23,9 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Utility to refine cells next to patches. Takes a patchName
and number of layers to refine. Works out cells within these layers
and refines those in the wall-normal direction.
Utility to refine cells next to patches.
Takes a patchName and number of layers to refine. Works out cells within
these layers and refines those in the wall-normal direction.
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -23,10 +23,11 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Utility to split cells with flat faces. Uses a geometric cut with a plane
dividing the edge angle into two so might produce funny cells. For hexes
it will use by default a cut from edge onto opposite edge (i.e. purely
topological).
Utility to split cells with flat faces.
Uses a geometric cut with a plane dividing the edge angle into two so
might produce funny cells. For hexes it will use by default a cut from
edge onto opposite edge (i.e. purely topological).
Options:
- split cells from cellSet only

View File

@ -47,6 +47,7 @@ Description
#include "cyclicPolyPatch.H"
#include "Swap.H"
#include "IFstream.H"
#include "readHexLabel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -92,6 +93,9 @@ DynamicList<label> cellGroupStartIndex;
DynamicList<label> cellGroupEndIndex;
DynamicList<label> cellGroupType;
// Special parsing of (incorrect) Cubit files
bool cubitFile = false;
void uniquify(word& name, HashSet<word>& patchNames)
{
@ -622,11 +626,20 @@ endOfSection {space}")"{space}
BEGIN(readZoneGroupData);
}
<readZoneGroupData>{space}{label}{space}{word}{space}{word}{space}{label}? {
<readZoneGroupData>{space}{hexLabel}{space}{word}{space}{word}{space}{label}? {
IStringStream zoneDataStream(YYText());
// cell zone-ID not in hexadecimal!!! Inconsistency
label zoneID(readLabel(zoneDataStream));
label zoneID = -1;
if (cubitFile)
{
zoneID = readHexLabel(zoneDataStream);
}
else
{
zoneID = readLabel(zoneDataStream);
}
groupType.insert(zoneID, word(zoneDataStream));
groupName.insert(zoneID, word(zoneDataStream));
@ -752,6 +765,7 @@ int main(int argc, char *argv[])
argList::validOptions.insert("scale", "scale factor");
argList::validOptions.insert("ignoreCellGroups", "cell group names");
argList::validOptions.insert("ignoreFaceGroups", "face group names");
argList::validOptions.insert("cubit", "");
argList args(argc, argv);
@ -774,6 +788,17 @@ int main(int argc, char *argv[])
args.optionLookup("ignoreFaceGroups")() >> ignoreFaceGroups;
}
cubitFile = args.options().found("cubit");
if (cubitFile)
{
Info<< nl
<< "Assuming Cubit generated file"
<< " (incorrect face orientation; hexadecimal zoneIDs)."
<< nl << endl;
}
# include "createTime.H"
fileName fluentFile(args.additionalArgs()[0]);
@ -827,7 +852,10 @@ int main(int argc, char *argv[])
)
{
fm[facei] = true;
faces[facei] = faces[facei].reverseFace();
if (!cubitFile)
{
faces[facei] = faces[facei].reverseFace();
}
Swap(owner[facei], neighbour[facei]);
}
}

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Reads .msh format generated by the Adventure system.
Converts .msh file generated by the Adventure system.
Note: the .msh format does not contain any boundary information. It is
purely a description of the internal mesh.

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
read Neutral file format as written by Netgen4.4.
Converts neutral file format as written by Netgen v4.4.
Example:

View File

@ -23,8 +23,8 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Calculate the dual of a polyMesh. Adheres to all the feature&patch edges.
Calculate the dual of a polyMesh. Adheres to all the feature and patch
edges.
Usage

View File

@ -79,7 +79,7 @@ int main(int argc, char *argv[])
scaleFactor = 1;
}
}
if (args.optionFound("solids"))
{
meshReaders::STARCD::keepSolids = true;

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Reads .ele and .node and .face files as written by tetgen.
Converts .ele and .node and .face files, written by tetgen.
Make sure to use add boundary attributes to the smesh file
(5 fifth column in the element section)

View File

@ -100,7 +100,7 @@ void blockDescriptor::setEdge(label edgeI, label start, label end, label dim)
scalar gExp = calcGexp(expand_[edgeI], dim);
// divide the line
lineDivide divEdge(curvedEdges_[nCEI], dim, 1.0/gExp);
lineDivide divEdge(curvedEdges_[nCEI], dim, 1.0/(gExp+SMALL));
pointField p = divEdge.points();
scalarList d = divEdge.lambdaDivisions();

View File

@ -1,6 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean libso extrudeModel
wclean
# ----------------------------------------------------------------- end-of-file

View File

@ -24,8 +24,8 @@ License
Description
Extrude mesh from existing patch (by default outwards facing normals;
optional flips faces)
or from patch read from file.
optional flips faces) or from patch read from file.
Note: Merges close points so be careful.
Type of extrusion prescribed by run-time selectable model.

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -23,11 +23,11 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Makes internal faces into boundary faces. Does not duplicate points. Use
mergeOrSplitBaffles if you want this.
Makes internal faces into boundary faces. Does not duplicate points, unlike
mergeOrSplitBaffles.
Note: if any coupled patch face is selected for baffling automatically
the opposite member is selected for baffling as well. Note that this
Note: if any coupled patch face is selected for baffling the opposite
member has to be selected for baffling as well. Note that this
is the same as repatching. This was added only for convenience so
you don't have to filter coupled boundary out of your set.
@ -128,6 +128,7 @@ int main(int argc, char *argv[])
argList::validArgs.append("faceZone");
argList::validArgs.append("patch");
argList::validOptions.insert("additionalPatches", "(patch2 .. patchN)");
argList::validOptions.insert("internalFacesOnly", "");
argList::validOptions.insert("overwrite", "");
# include "setRootCase.H"
@ -183,6 +184,12 @@ int main(int argc, char *argv[])
bool overwrite = args.optionFound("overwrite");
bool internalFacesOnly = args.optionFound("internalFacesOnly");
if (internalFacesOnly)
{
Info<< "Not converting faces on non-coupled patches." << nl << endl;
}
// Read objects in time directory
@ -234,7 +241,21 @@ int main(int argc, char *argv[])
// guarantees that when e.g. creating a cyclic all faces from one
// side come first and faces from the other side next.
// Whether first use of face (modify) or consecutive (add)
PackedBoolList modifiedFace(mesh.nFaces());
// Never modify coupled faces
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (pp.coupled())
{
forAll(pp, i)
{
modifiedFace[pp.start()+i] = 1;
}
}
}
label nModified = 0;
forAll(newPatches, i)
{
@ -281,6 +302,8 @@ int main(int argc, char *argv[])
modifiedFace // modify or add status
);
}
nModified++;
}
}
@ -333,16 +356,27 @@ int main(int argc, char *argv[])
// Modify any boundary faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~
// Normal boundary:
// - move to new patch. Might already be back-to-back baffle
// you want to add cyclic to. Do warn though.
//
// Processor boundary:
// - do not move to cyclic
// - add normal patches though.
// For warning once per patch.
labelHashSet patchWarned;
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (patches[newPatchI].coupled() && pp.coupled())
if (pp.coupled() && patches[newPatchI].coupled())
{
// Do not allow coupled faces to be moved to different coupled
// patches.
}
else
else if (pp.coupled() || !internalFacesOnly)
{
forAll(pp, i)
{
@ -352,6 +386,19 @@ int main(int argc, char *argv[])
if (zoneFaceI != -1)
{
if (patchWarned.insert(patchI))
{
WarningIn(args.executable())
<< "Found boundary face (in patch " << pp.name()
<< ") in faceZone " << fZone.name()
<< " to convert to baffle patch "
<< patches[newPatchI].name()
<< endl
<< " Run with -internalFacesOnly option"
<< " if you don't wish to convert"
<< " boundary faces." << endl;
}
modifyOrAddFace
(
meshMod,
@ -364,6 +411,7 @@ int main(int argc, char *argv[])
fZone.flipMap()[zoneFaceI], // face flip in zone
modifiedFace // modify or add status
);
nModified++;
}
}
}
@ -371,7 +419,7 @@ int main(int argc, char *argv[])
}
Info<< "Converted " << returnReduce(modifiedFace.count(), sumOp<label>())
Info<< "Converted " << returnReduce(nModified, sumOp<label>())
<< " faces into boundary faces on patch " << patchName << nl << endl;
if (!overwrite)

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -26,7 +26,7 @@ Application
flattenMesh
Description
Flatten the front and back planes of a 2D cartesian mesh.
Flattens the front and back planes of a 2D cartesian mesh.
\*---------------------------------------------------------------------------*/
@ -90,7 +90,7 @@ int main(int argc, char *argv[])
}
}
twoDCorr.correctPoints(points);
twoDCorr.correctPoints(points);
// Set the precision of the points data to 10
IOstream::defaultPrecision(10);

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Pick up cells with cell centre 'inside' of surface. Requires surface
Picks up cells with cell centre 'inside' of surface. Requires surface
to be closed and singly connected.
\*---------------------------------------------------------------------------*/

View File

@ -26,7 +26,7 @@ Application
mergeOrSplitBaffles
Description
Detect faces that share points (baffles). Either merge them or
Detects faces that share points (baffles). Either merge them or
duplicate the points.
Notes:

View File

@ -23,7 +23,6 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Mirrors a mesh around a given plane.
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -23,9 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Utility to refine cells in multiple directions. Either supply -all
option to refine all cells (3D refinement for 3D cases; 2D for 2D cases)
or reads a refineMeshDict with
Utility to refine cells in multiple directions.
Either supply -all option to refine all cells (3D refinement for 3D
cases; 2D for 2D cases) or reads a refineMeshDict with
- cellSet to refine
- directions to refine

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -31,12 +31,11 @@ Description
#include "Time.H"
#include "polyMesh.H"
#include "globalMeshData.H"
#include "topoSetSource.H"
#include "topoSet.H"
#include "IStringStream.H"
#include "topoSet.H"
#include "cellSet.H"
#include "faceSet.H"
#include "pointSet.H"
#include "topoSetSource.H"
#include "OFstream.H"
#include "IFstream.H"
#include "demandDrivenData.H"

View File

@ -23,8 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Splits mesh into multiple regions. Each region is defined as a domain
whose cells can all be reached by cell-face-cell walking without crossing
Splits mesh into multiple regions.
Each region is defined as a domain whose cells can all be reached by
cell-face-cell walking without crossing
- boundary faces
- additional faces from faceset (-blockedFaces faceSet).
- any face inbetween differing cellZones (-cellZones)

View File

@ -27,7 +27,10 @@ Application
Description
Transforms the mesh points in the polyMesh directory according to the
options:
translate, rotate and scale options.
Usage
Options are:
-translate vector
Translates the points by the given vector,

View File

@ -26,9 +26,10 @@ Application
reconstructParMesh
Description
Reconstructs a mesh using geometric information only. Writes
point/face/cell procAddressing so afterwards reconstructPar can be used to
reconstruct fields.
Reconstructs a mesh using geometric information only.
Writes point/face/cell procAddressing so afterwards reconstructPar can be
used to reconstruct fields.
Note:
- uses geometric matching tolerance (set with -mergeTol option)

View File

@ -26,7 +26,17 @@ Application
redistributeMeshPar
Description
Parallel redecomposition of mesh.
Redistributes existing decomposed mesh and fields according to the current
settings in the decomposeParDict file.
Must be run on maximum number of source and destination processors.
Balances mesh and writes new mesh to new time directory.
Can also work like decomposePar:
mkdir processor0
cp -r constant processor0
mpirun -np ddd redistributeMeshPar -parallel
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -36,8 +36,8 @@ Usage
@param -ascii \n
Write Ensight data in ASCII format instead of "C Binary"
@param -zeroTime \n
Include the often incomplete initial conditions.
@param -noZero \n
Exclude the often incomplete initial conditions.
@param -index \<start\>\n
Ignore the time index contained in the time file and use a

View File

@ -24,6 +24,7 @@ License
Description
Translates foam output to GMV readable files.
A free post-processor with available binaries from
http://www-xdiv.lanl.gov/XCM/gmv/

View File

@ -4,3 +4,5 @@ set -x
rm -rf PV3FoamReader/Make
wclean libso vtkPV3Foam
# ----------------------------------------------------------------- end-of-file

View File

@ -261,11 +261,15 @@ Foam::vtkPV3Foam::vtkPV3Foam
// Set the case as an environment variable - some BCs might use this
if (fullCasePath.name().find("processor", 0) == 0)
{
setEnv("FOAM_CASE", fullCasePath.path(), true);
const fileName globalCase = fullCasePath.path();
setEnv("FOAM_CASE", globalCase, true);
setEnv("FOAM_CASENAME", globalCase.name(), true);
}
else
{
setEnv("FOAM_CASE", fullCasePath, true);
setEnv("FOAM_CASENAME", fullCasePath.name(), true);
}
// look for 'case{region}.OpenFOAM'
@ -299,6 +303,7 @@ Foam::vtkPV3Foam::vtkPV3Foam
{
Info<< "fullCasePath=" << fullCasePath << nl
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
<< "region=" << meshRegion_ << endl;
}

View File

@ -359,4 +359,5 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
return vtkmesh;
}
// ************************************************************************* //

View File

@ -38,7 +38,6 @@ Description
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
vtkPolyData* Foam::vtkPV3Foam::faceZoneVTKMesh
(
const fvMesh& mesh,
@ -111,7 +110,6 @@ vtkPolyData* Foam::vtkPV3Foam::faceZoneVTKMesh
}
vtkPolyData* Foam::vtkPV3Foam::pointZoneVTKMesh
(
const fvMesh& mesh,
@ -148,4 +146,5 @@ vtkPolyData* Foam::vtkPV3Foam::pointZoneVTKMesh
return vtkmesh;
}
// ************************************************************************* //

View File

@ -132,7 +132,6 @@ void Foam::vtkPV3Foam::convertPointFields
}
template<class Type>
void Foam::vtkPV3Foam::convertPointFieldBlock
(
@ -162,7 +161,6 @@ void Foam::vtkPV3Foam::convertPointFieldBlock
}
template<class Type>
void Foam::vtkPV3Foam::convertPointField
(
@ -193,7 +191,7 @@ void Foam::vtkPV3Foam::convertPointField
pointData->SetNumberOfTuples(nPoints + addPointCellLabels.size());
pointData->SetNumberOfComponents(nComp);
pointData->Allocate(nComp*(nPoints + addPointCellLabels.size()));
pointData->SetName(ptf.name().c_str());
pointData->SetName(tf.name().c_str());
if (debug)
{
@ -269,6 +267,7 @@ void Foam::vtkPV3Foam::convertPointField
pointData->Delete();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif

View File

@ -519,6 +519,5 @@ void Foam::vtkPV3Foam::updateInfoLagrangianFields()
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -338,4 +338,5 @@ void Foam::vtkPV3Foam::printMemory()
}
}
// ************************************************************************* //

View File

@ -23,7 +23,8 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Reader module for Fieldview9 to read Foam mesh&data.
Reader module for Fieldview9 to read OpenFOAM mesh and data.
Creates new 'fvbin' type executable which needs to be installed in place
of bin/fvbin.

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object particleTrackProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
cloudName reactingCloud1;
sampleFrequency 1;
maxPositions 1000000;
// ************************************************************************* //

View File

@ -23,6 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Generates an .obj file to plot a probability distribution function
\*---------------------------------------------------------------------------*/
@ -48,7 +49,7 @@ int main(int argc, char *argv[])
(
pdf::New(pdfDictionary, rndGen)
);
scalar xMin = p->minValue();
scalar xMax = p->maxValue();

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -26,7 +26,8 @@ Application
CreateTurbulenceFields
Description
Creates a full setturbulence fields.
Creates a full set of turbulence fields.
- Currently does not output nut and nuTilda
Source files:

View File

@ -28,6 +28,7 @@ Application
Description
Calculates and writes the Co number as a surfaceScalarField obtained
from field phi.
The -noWrite option just outputs the max values without writing the
field.

View File

@ -29,6 +29,7 @@ Description
Calculates and writes the second largest eigenvalue of the sum of the
square of the symmetrical and anti-symmetrical parts of the velocity
gradient tensor.
The -noWrite option has no meaning.
\*---------------------------------------------------------------------------*/

View File

@ -27,8 +27,9 @@ Application
Description
Calculates and optionally writes the local Mach number from the velocity
field U at each time. The -nowrite option just outputs the max value
without writing the field.
field U at each time.
The -nowrite option just outputs the max value without writing the field.
\*---------------------------------------------------------------------------*/

View File

@ -28,6 +28,7 @@ Application
Description
Calculates and writes the Pe number as a surfaceScalarField obtained from
field phi.
The -noWrite option just outputs the max/min values without writing
the field.

View File

@ -27,6 +27,7 @@ Application
Description
Calculates and writes the second invariant of the velocity gradient tensor.
The -noWrite option just outputs the max/min values without writing
the field.

View File

@ -27,6 +27,7 @@ Application
Description
Calculates and writes the enstrophy of the velocity field U.
The -noWrite option just outputs the max/min values without writing the
field.

View File

@ -27,6 +27,7 @@ Application
Description
Calculates and writes the flowType of velocity field U.
The -noWrite option has no meaning.
The flow type parameter is obtained according to the following equation:

View File

@ -27,6 +27,7 @@ Application
Description
Calculates and writes the scalar field of uprime (sqrt(2/3 k)).
The -noWrite option just outputs the max/min values without writing
the field.

View File

@ -27,6 +27,7 @@ Application
Description
Calculates and writes the vorticity of velocity field U.
The -noWrite option just outputs the max/min values without writing
the field.

View File

@ -2,10 +2,17 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lincompressibleRASModels \
-lincompressibleTransportModels \
-lfiniteVolume
-lincompressibleRASModels \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools \
-lsampling

View File

@ -26,25 +26,174 @@ Application
yPlusRAS
Description
Calculates and reports yPlus for all wall patches, for the specified times.
Calculates and reports yPlus for all wall patches, for the specified times
when using RAS turbulence models.
Default behaviour assumes operating in incompressible mode. To apply to
compressible RAS cases, use the -compressible option.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "RASModel.H"
#include "wallFvPatch.H"
#include "incompressible/RAS/RASModel/RASModel.H"
#include "nutWallFunction/nutWallFunctionFvPatchScalarField.H"
#include "basicPsiThermo.H"
#include "compressible/RAS/RASModel/RASModel.H"
#include "mutWallFunction/mutWallFunctionFvPatchScalarField.H"
#include "wallDist.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void calcIncompressibleYPlus
(
const fvMesh& mesh,
const Time& runTime,
const volVectorField& U,
volScalarField& yPlus
)
{
typedef incompressible::RASModels::nutWallFunctionFvPatchScalarField
wallFunctionPatchField;
#include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::RASModel> RASModel
(
incompressible::RASModel::New(U, phi, laminarTransport)
);
const volScalarField::GeometricBoundaryField nutPatches =
RASModel->nut()().boundaryField();
bool foundNutPatch = false;
forAll(nutPatches, patchi)
{
if (isA<wallFunctionPatchField>(nutPatches[patchi]))
{
foundNutPatch = true;
const wallFunctionPatchField& nutPw =
dynamic_cast<const wallFunctionPatchField&>
(nutPatches[patchi]);
yPlus.boundaryField()[patchi] = nutPw.yPlus();
const scalarField& Yp = yPlus.boundaryField()[patchi];
Info<< "Patch " << patchi
<< " named " << nutPw.patch().name()
<< " y+ : min: " << min(Yp) << " max: " << max(Yp)
<< " average: " << average(Yp) << nl << endl;
}
}
if (!foundNutPatch)
{
Info<< " no " << wallFunctionPatchField::typeName << " patches"
<< endl;
}
}
void calcCompressibleYPlus
(
const fvMesh& mesh,
const Time& runTime,
const volVectorField& U,
volScalarField& yPlus
)
{
typedef compressible::RASModels::mutWallFunctionFvPatchScalarField
wallFunctionPatchField;
IOobject rhoHeader
(
"rho",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (!rhoHeader.headerOk())
{
Info<< " no rho field" << endl;
return;
}
Info << "Reading field rho\n" << endl;
volScalarField rho(rhoHeader, mesh);
#include "compressibleCreatePhi.H"
autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();
autoPtr<compressible::RASModel> RASModel
(
compressible::RASModel::New
(
rho,
U,
phi,
thermo
)
);
const volScalarField::GeometricBoundaryField mutPatches =
RASModel->mut()().boundaryField();
bool foundMutPatch = false;
forAll(mutPatches, patchi)
{
if (isA<wallFunctionPatchField>(mutPatches[patchi]))
{
foundMutPatch = true;
const wallFunctionPatchField& mutPw =
dynamic_cast<const wallFunctionPatchField&>
(mutPatches[patchi]);
yPlus.boundaryField()[patchi] = mutPw.yPlus();
const scalarField& Yp = yPlus.boundaryField()[patchi];
Info<< "Patch " << patchi
<< " named " << mutPw.patch().name()
<< " y+ : min: " << min(Yp) << " max: " << max(Yp)
<< " average: " << average(Yp) << nl << endl;
}
}
if (!foundMutPatch)
{
Info<< " no " << wallFunctionPatchField::typeName << " patches"
<< endl;
}
}
int main(int argc, char *argv[])
{
timeSelector::addOptions();
#include "addRegionOption.H"
argList::validOptions.insert("compressible","");
#include "setRootCase.H"
# include "createTime.H"
#include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
#include "createNamedMesh.H"
bool compressible = args.optionFound("compressible");
forAll(timeDirs, timeI)
{
@ -76,49 +225,35 @@ int main(int argc, char *argv[])
dimensionedScalar("yPlus", dimless, 0.0)
);
Info << "Reading field U\n" << endl;
volVectorField U
IOobject UHeader
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
# include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::RASModel> RASModel
(
incompressible::RASModel::New(U, phi, laminarTransport)
);
const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi)
if (UHeader.headerOk())
{
const fvPatch& currPatch = patches[patchi];
Info << "Reading field U\n" << endl;
volVectorField U(UHeader, mesh);
if (typeid(currPatch) == typeid(wallFvPatch))
if (compressible)
{
yPlus.boundaryField()[patchi] = RASModel->yPlus(patchi);
const scalarField& Yp = yPlus.boundaryField()[patchi];
Info<< "Patch " << patchi
<< " named " << currPatch.name()
<< " y+ : min: " << min(Yp) << " max: " << max(Yp)
<< " average: " << average(Yp) << nl << endl;
calcCompressibleYPlus(mesh, runTime, U, yPlus);
}
else
{
calcIncompressibleYPlus(mesh, runTime, U, yPlus);
}
}
else
{
Info<< " no U field" << endl;
}
Info<< "Writing yPlus to field "
<< yPlus.name() << nl << endl;
Info<< "Writing yPlus to field " << yPlus.name() << nl << endl;
yPlus.write();
}
@ -128,4 +263,5 @@ int main(int argc, char *argv[])
return 0;
}
// ************************************************************************* //

View File

@ -1,3 +0,0 @@
applyWallFunctionBounaryConditions.C
EXE = $(FOAM_APPBIN)/applyWallFunctionBounaryConditions

View File

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

View File

@ -0,0 +1,3 @@
applyWallFunctionBoundaryConditions.C
EXE = $(FOAM_APPBIN)/applyWallFunctionBoundaryConditions

View File

@ -0,0 +1,13 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
EXE_LIBS = \
-lincompressibleRASModels \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lfiniteVolume

View File

@ -26,13 +26,13 @@ Application
applyWallFunctionBounaryConditions
Description
Updates OpenFOAM RAS cases to use the new wall function framework
Updates OpenFOAM RAS cases to use the new (v1.6) wall function framework
Attempts to determine whether case is compressible or incompressible, or
can be supplied with -compressible command line argument
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "fvMesh.H"
#include "Time.H"
@ -41,6 +41,16 @@ Description
#include "wallPolyPatch.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H"
#include "incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H"
#include "compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -104,25 +114,6 @@ bool caseIsCompressible(const fvMesh& mesh)
}
}
// Attempt hydrostatic pressure field
IOobject pdHeader
(
"pd",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (pdHeader.headerOk())
{
volScalarField pd(pdHeader, mesh);
if (pd.dimensions() == dimMass/sqr(dimTime)/dimLength)
{
return true;
}
}
// If none of the above are true, assume that the case is incompressible
return false;
}
@ -230,15 +221,125 @@ void replaceBoundaryType
}
void updateCompressibleCase(const fvMesh& mesh)
{
Info<< "Case treated as compressible" << nl << endl;
createVolScalarField
(
mesh,
"mut",
dimArea/dimTime*dimDensity
);
replaceBoundaryType
(
mesh,
"mut",
compressible::RASModels::mutWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"epsilon",
compressible::RASModels::epsilonWallFunctionFvPatchScalarField::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"omega",
compressible::RASModels::omegaWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"k",
compressible::RASModels::kqRWallFunctionFvPatchField<scalar>::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"q",
compressible::RASModels::kqRWallFunctionFvPatchField<scalar>::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"R",
compressible::RASModels::kqRWallFunctionFvPatchField<symmTensor>::
typeName,
"(0 0 0 0 0 0)"
);
}
void updateIncompressibleCase(const fvMesh& mesh)
{
Info<< "Case treated as incompressible" << nl << endl;
createVolScalarField(mesh, "nut", dimArea/dimTime);
replaceBoundaryType
(
mesh,
"nut",
incompressible::RASModels::nutWallFunctionFvPatchScalarField::typeName,
"0"
);
replaceBoundaryType
(
mesh,
"epsilon",
incompressible::RASModels::epsilonWallFunctionFvPatchScalarField::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"omega",
incompressible::RASModels::omegaWallFunctionFvPatchScalarField::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"k",
incompressible::RASModels::kqRWallFunctionFvPatchField<scalar>::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"q",
incompressible::RASModels::kqRWallFunctionFvPatchField<scalar>::
typeName,
"0"
);
replaceBoundaryType
(
mesh,
"R",
incompressible::RASModels::kqRWallFunctionFvPatchField<symmTensor>::
typeName,
"(0 0 0 0 0 0)"
);
}
int main(int argc, char *argv[])
{
# include "addTimeOptions.H"
#include "addTimeOptions.H"
argList::validOptions.insert("compressible", "");
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
bool compressible = args.optionFound("compressible");
@ -248,28 +349,13 @@ int main(int argc, char *argv[])
if (compressible || caseIsCompressible(mesh))
{
Info<< "Case treated as compressible" << nl << endl;
createVolScalarField
(
mesh,
"mut",
dimArea/dimTime*dimDensity
);
replaceBoundaryType(mesh, "mut", "mutWallFunction", "0");
updateCompressibleCase(mesh);
}
else
{
Info<< "Case treated as incompressible" << nl << endl;
createVolScalarField(mesh, "nut", dimArea/dimTime);
replaceBoundaryType(mesh, "nut", "nutWallFunction", "0");
updateIncompressibleCase(mesh);
}
replaceBoundaryType(mesh, "epsilon", "epsilonWallFunction", "0");
replaceBoundaryType(mesh, "omega", "omegaWallFunction", "0");
replaceBoundaryType(mesh, "k", "kQRWallFunction", "0");
replaceBoundaryType(mesh, "q", "kQRWallFunction", "0");
replaceBoundaryType(mesh, "R", "kQRWallFunction", "(0 0 0 0 0 0)");
Info<< "End\n" << endl;
return 0;

View File

@ -26,8 +26,10 @@ Application
changeDictionary
Description
Simple dictionary changing tool. Can be used to e.g. change the patch
type. Reads dictionaries (fields) and entries to change from a dictionary.
Utility to change dictionary entries, e.g. can be used to change the patch
type in the field and polyMesh/boundary files.
Reads dictionaries (fields) and entries to change from a dictionary.
E.g. to make the @em movingWall a @em fixedValue for @em p, the
@c system/changeDictionaryDict would contain the following:
@verbatim

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -47,7 +47,7 @@ void UnMapped(const IOobjectList& objects)
++fieldIter
)
{
mv(fieldIter()->objectPath(), fieldIter()->objectPath() + ".unmapped");
mvBak(fieldIter()->objectPath(), "unmapped");
}
}

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -22,6 +22,9 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Initialises fields for a molecular dynamics (MD) simulation.
\*---------------------------------------------------------------------------*/
#include "md.H"

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/