Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2010-10-08 14:38:12 +01:00
6 changed files with 244 additions and 4 deletions

View File

@ -123,7 +123,6 @@
fvSolution during a calculation
+ =streamLine=: generate streamlines; ouputs both trajectory and field data
* New tutorials
There is a large number of new tutorials to support the new solvers in the
release.

View File

@ -0,0 +1,4 @@
testCompactIOList.C
EXE = $(FOAM_APPBIN)/CompactIOList

View File

@ -0,0 +1,3 @@
EXE_INC =
EXE_LIBS =

View File

@ -0,0 +1,181 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 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
testCompactIOList
Description
Simple demonstration and test application for the CompactIOList container
\*---------------------------------------------------------------------------*/
#include "IOstreams.H"
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
IOstream::streamFormat format=IOstream::BINARY;
// IOstream::streamFormat format=IOstream::ASCII;
const label size = 20000000;
// Old format
// ~~~~~~~~~~
{
// Construct big faceList in old format
faceIOList faces2
(
IOobject
(
"faces2",
runTime.constant(),
polyMesh::meshSubDir,
runTime,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
size
);
const face f(identity(4));
forAll(faces2, i)
{
faces2[i] = f;
}
Info<< "Constructed faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
// Write binary
faces2.writeObject
(
format,
IOstream::currentVersion,
IOstream::UNCOMPRESSED
);
Info<< "Written old format faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
// Read
faceIOList faces3
(
IOobject
(
"faces2",
runTime.constant(),
polyMesh::meshSubDir,
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
Info<< "Read old format " << faces3.size() << " faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
}
// New format
// ~~~~~~~~~~
{
// Construct big faceList in new format
faceCompactIOList faces2
(
IOobject
(
"faces2",
runTime.constant(),
polyMesh::meshSubDir,
runTime,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
size
);
const face f(identity(4));
forAll(faces2, i)
{
faces2[i] = f;
}
Info<< "Constructed new format faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
// Write binary
faces2.writeObject
(
format,
IOstream::currentVersion,
IOstream::UNCOMPRESSED
);
Info<< "Written new format faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
// Read
faceCompactIOList faces3
(
IOobject
(
"faces2",
runTime.constant(),
polyMesh::meshSubDir,
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
Info<< "Read new format " << faces3.size() << " faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
}
return 0;
}
// ************************************************************************* //

View File

@ -46,4 +46,60 @@ timePrecision 6;
runTimeModifiable true;
functions
{
// Make sure all fields for functionObjects are loaded. Prevents any
// problems running with execFlowFunctionObjects.
readFields
{
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
type readFields;
fields (p U k);
}
streamLines
{
type streamLine;
// Output every
outputControl outputTime;
// outputInterval 10;
setFormat vtk; //gnuplot; //xmgr; //raw; //jplot;
// Velocity field to use for tracking.
U U;
// Tracked forwards (+U) or backwards (-U)
trackForward true;
// Names of fields to sample. Should contain above velocity field!
fields (p U k);
// Cells particles can travel before being removed
lifeTime 1000;
// Cloud name to use
cloudName particleTracks;
// Seeding method. See the sampleSets in sampleDict.
seedSampleSet uniform; //cloud;//triSurfaceMeshPointSet;
uniformCoeffs
{
type uniform;
axis x; //distance;
// Note: tracks slightly offset so as not to be on a face
start (-1.001 1E-7 0.0011);
end (-1.001 1E-7 1.0011);
nPoints 20;
}
}
}
// ************************************************************************* //

View File

@ -288,9 +288,6 @@ meshQualityControls
// Set to 180 to disable.
maxConcave 80;
//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-20;