Merge branch 'master' into particleInteractions

This commit is contained in:
graham
2010-04-09 18:04:49 +01:00
174 changed files with 1269 additions and 1315 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -101,7 +101,7 @@ public:
explicit inline DynamicList(const label);
//- Construct copy.
explicit inline DynamicList
inline DynamicList
(
const DynamicList<T, SizeInc, SizeMult, SizeDiv>&
);
@ -116,7 +116,7 @@ public:
//- Construct by transferring the parameter contents
explicit inline DynamicList(const Xfer<List<T> >&);
//- Construct from Istream. Size set to size of read list.
//- Construct from Istream. Size set to size of list read.
explicit DynamicList(Istream&);

View File

@ -518,11 +518,28 @@ bool Foam::Time::loop()
if (running)
{
operator++();
if (!subCycling_)
{
readModifiedObjects();
if (timeIndex_ == startTimeIndex_)
{
functionObjects_.start();
}
else
{
functionObjects_.execute();
}
}
// Check update the "running" status following the "++" operation
// to take into account possible side-effects from functionObjects
running = run();
if (running)
{
operator++();
}
}
return running;
@ -667,20 +684,6 @@ Foam::Time& Foam::Time::operator+=(const scalar deltaT)
Foam::Time& Foam::Time::operator++()
{
if (!subCycling_)
{
readModifiedObjects();
if (timeIndex_ == startTimeIndex_)
{
functionObjects_.start();
}
else
{
functionObjects_.execute();
}
}
deltaT0_ = deltaTSave_;
deltaTSave_ = deltaT_;

View File

@ -750,6 +750,20 @@ Foam::argList::~argList()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::argList::printNotes() const
{
// output notes directly - no automatic text wrapping
if (!notes.empty())
{
Info<< nl;
forAllConstIter(SLList<string>, notes, iter)
{
Info<< iter().c_str() << nl;
}
}
}
void Foam::argList::printUsage() const
{
Info<< "\nUsage: " << executable_ << " [OPTIONS]";
@ -819,20 +833,7 @@ void Foam::argList::printUsage() const
);
// output notes directly - no automatic text wrapping
if (!notes.empty())
{
Info<< nl;
for
(
SLList<string>::const_iterator iter = notes.begin();
iter != notes.end();
++iter
)
{
Info<< iter().c_str() << nl;
}
}
printNotes();
Info<< nl
<<"Using OpenFOAM-" << Foam::FOAMversion

View File

@ -329,6 +329,9 @@ public:
// Print
//- Print notes (if any)
void printNotes() const;
//- Print usage
void printUsage() const;

View File

@ -6,7 +6,7 @@ wmake libso field
wmake libso forces
wmake libso IO
wmake libso utilities
wmake libso residualControl
wmake libso jobControl
wmake libso systemCall
# ----------------------------------------------------------------- end-of-file

View File

@ -29,10 +29,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(writeRegisteredObject, 0);
}
defineTypeNameAndDebug(Foam::writeRegisteredObject, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -36,29 +36,29 @@ writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
runTimeModifiable true;
functions
{
fieldAverage1
{
// Type of functionObject
type fieldAverage;
type fieldAverage;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldAverage.so");
// Function object enabled flag
enabled true;
enabled true;
// When to output the average fields
outputControl outputTime;
outputControl outputTime;
// Fields to be averaged - runTime modifiable
fields

View File

@ -31,10 +31,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(fieldMinMax, 0);
}
defineTypeNameAndDebug(Foam::fieldMinMax, 0);
template<>

View File

@ -30,31 +30,27 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
defineTypeNameAndDebug(Foam::fieldValues::cellSource, 0);
template<>
const char* Foam::NamedEnum<Foam::fieldValues::cellSource::sourceType, 1>::
names[] =
{
namespace fieldValues
{
defineTypeNameAndDebug(cellSource, 0);
}
"cellZone"
};
template<>
const char* NamedEnum<fieldValues::cellSource::sourceType, 1>::
names[] = {"cellZone"};
const Foam::NamedEnum<Foam::fieldValues::cellSource::sourceType, 1>
Foam::fieldValues::cellSource::sourceTypeNames_;
const NamedEnum<fieldValues::cellSource::sourceType, 1>
fieldValues::cellSource::sourceTypeNames_;
template<>
const char* Foam::NamedEnum<Foam::fieldValues::cellSource::operationType, 5>::
names[] =
{
"none", "sum", "volAverage", "volIntegrate", "weightedAverage"
};
template<>
const char* NamedEnum<fieldValues::cellSource::operationType, 5>::
names[] =
{
"none", "sum", "volAverage", "volIntegrate", "weightedAverage"
};
const NamedEnum<fieldValues::cellSource::operationType, 5>
fieldValues::cellSource::operationTypeNames_;
}
const Foam::NamedEnum<Foam::fieldValues::cellSource::operationType, 5>
Foam::fieldValues::cellSource::operationTypeNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -238,4 +234,3 @@ void Foam::fieldValues::cellSource::write()
// ************************************************************************* //

View File

@ -37,16 +37,16 @@ writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
runTimeModifiable true;
functions
(
{
faceObj1
{
type faceSource;
@ -60,6 +60,7 @@ functions
// source faceZone;
// sourceName f0;
operation areaAverage;
fields
(
p
@ -79,6 +80,7 @@ functions
source faceZone;
sourceName f0;
operation sum;
fields
(
phi
@ -96,13 +98,13 @@ functions
source cellZone;
sourceName c0;
operation volAverage;
fields
(
p
U
);
}
);
}
// ************************************************************************* //

View File

@ -34,31 +34,27 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
defineTypeNameAndDebug(Foam::fieldValues::faceSource, 0);
template<>
const char* Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 2>::
names[] =
{
namespace fieldValues
{
defineTypeNameAndDebug(faceSource, 0);
}
"faceZone", "patch"
};
template<>
const char* NamedEnum<fieldValues::faceSource::sourceType, 2>::
names[] = {"faceZone", "patch"};
const Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 2>
Foam::fieldValues::faceSource::sourceTypeNames_;
const NamedEnum<fieldValues::faceSource::sourceType, 2>
fieldValues::faceSource::sourceTypeNames_;
template<>
const char* Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 5>::
names[] =
{
"none", "sum", "areaAverage", "areaIntegrate", "weightedAverage"
};
template<>
const char* NamedEnum<fieldValues::faceSource::operationType, 5>::
names[] =
{
"none", "sum", "areaAverage", "areaIntegrate", "weightedAverage"
};
const NamedEnum<fieldValues::faceSource::operationType, 5>
fieldValues::faceSource::operationTypeNames_;
}
const Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 5>
Foam::fieldValues::faceSource::operationTypeNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -16,7 +16,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
functions
(
{
readFields1
{
type readFields;
@ -24,11 +24,13 @@ functions
enabled true;
outputControl timeStep;
outputInterval 1;
fields
(
interpolateU
);
}
faceObj2
{
type faceSource;
@ -41,12 +43,12 @@ functions
source faceZone;
sourceName f0;
operation areaAverage;
fields
(
interpolateU
);
}
);
}
// ************************************************************************* //

View File

@ -28,10 +28,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(readFields, 0);
}
defineTypeNameAndDebug(Foam::readFields, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -31,14 +31,17 @@ License
namespace Foam
{
defineTypeNameAndDebug(streamLineParticle, 0);
defineParticleTypeNameAndDebug(streamLineParticle, 0);
defineTemplateTypeNameAndDebugWithName
(
IOField<vectorField>,
"vectorFieldField",
0
);
};
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -30,7 +30,7 @@ License
namespace Foam
{
defineTemplateTypeNameAndDebug(Cloud<streamLineParticle>, 0);
};
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -30,10 +30,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(forceCoeffs, 0);
}
defineTypeNameAndDebug(Foam::forceCoeffs, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -39,10 +39,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(forces, 0);
}
defineTypeNameAndDebug(Foam::forces, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionConstraints
{
defineTypeNameAndDebug(fixedAxis, 0);
addToRunTimeSelectionTable
(
sixDoFRigidBodyMotionConstraint,
fixedAxis,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionConstraints
{
defineTypeNameAndDebug(fixedLine, 0);
addToRunTimeSelectionTable
(
sixDoFRigidBodyMotionConstraint,
fixedLine,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionConstraints
{
defineTypeNameAndDebug(fixedOrientation, 0);
addToRunTimeSelectionTable
(
sixDoFRigidBodyMotionConstraint,
fixedOrientation,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionConstraints
{
defineTypeNameAndDebug(fixedPlane, 0);
addToRunTimeSelectionTable
(
sixDoFRigidBodyMotionConstraint,
fixedPlane,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionConstraints
{
defineTypeNameAndDebug(fixedPoint, 0);
addToRunTimeSelectionTable
(
sixDoFRigidBodyMotionConstraint,
fixedPoint,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -35,14 +35,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionRestraints
{
defineTypeNameAndDebug(linearAxialAngularSpring, 0);
addToRunTimeSelectionTable
(
sixDoFRigidBodyMotionRestraint,
linearAxialAngularSpring,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionRestraints
{
defineTypeNameAndDebug(linearSpring, 0);
addToRunTimeSelectionTable
(
sixDoFRigidBodyMotionRestraint,
linearSpring,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionRestraints
{
defineTypeNameAndDebug(sphericalAngularSpring, 0);
addToRunTimeSelectionTable
(
sixDoFRigidBodyMotionRestraint,
sphericalAngularSpring,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -36,14 +36,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionRestraints
{
defineTypeNameAndDebug(tabulatedAxialAngularSpring, 0);
addToRunTimeSelectionTable
(
sixDoFRigidBodyMotionRestraint,
tabulatedAxialAngularSpring,
dictionary
);
};
};
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -0,0 +1,7 @@
abortCalculation/abortCalculation.C
abortCalculation/abortCalculationFunctionObject.C
residualControl/residualControl.C
residualControl/residualControlFunctionObject.C
LIB = $(FOAM_LIBBIN)/libjobControl

View File

@ -31,10 +31,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(abortCalculation, 0);
}
defineTypeNameAndDebug(Foam::abortCalculation, 0);
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -1,4 +1,4 @@
*--------------------------------*- C++ -*----------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
@ -37,31 +37,32 @@ writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
runTimeModifiable true;
functions
(
{
convergenceChecks
{
type residualControl;
functionObjectLibs ( "libresidualControl.so" );
outputControl timeStep;
outputInterval 1;
type residualControl;
functionObjectLibs ( "libjobControl.so" );
outputControl timeStep;
outputInterval 1;
maxResiduals
(
(p 5e-4)
(U 1e-3)
);
}
);
{
p 5e-4;
U 1e-3;
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}
}
}
// ************************************************************************* //

View File

@ -24,40 +24,35 @@ License
\*---------------------------------------------------------------------------*/
#include "residualControl.H"
#include "dictionary.H"
#include "fvMesh.H"
#include "Time.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(residualControl, 0);
}
defineTypeNameAndDebug(Foam::residualControl, 0);
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool Foam::residualControl::checkCriteria(const bool output) const
bool Foam::residualControl::checkCriteria(const bool verbose) const
{
bool achieved = true;
const fvMesh& mesh = static_cast<const fvMesh&>(obr_);
const dictionary& solverDict = mesh.solverPerformanceDict();
forAll(maxResiduals_, i)
forAllConstIter(dictionary, solverDict, iter)
{
const word& variableName = maxResiduals_[i].first();
if (solverDict.found(variableName))
const word& variableName = iter().keyword();
scalar maxResidual;
if (maxResiduals_.readIfPresent(variableName, maxResidual))
{
const scalar maxResidual = maxResiduals_[i].second();
const lduMatrix::solverPerformance
sp(solverDict.lookup(variableName));
const scalar eqnResidual = sp.initialResidual();
const scalar eqnResidual =
lduMatrix::solverPerformance(iter().stream()).initialResidual();
achieved = achieved && (eqnResidual < maxResidual);
if (output)
if (verbose)
{
Info<< " " << variableName
<< ": requested max residual = " << maxResidual
@ -121,7 +116,7 @@ void Foam::residualControl::read(const dictionary& dict)
{
if (active_)
{
dict.lookup("maxResiduals") >> maxResiduals_;
maxResiduals_ = dict.subDict("maxResiduals");
}
}

View File

@ -37,8 +37,8 @@ SourceFiles
#ifndef residualControl_H
#define residualControl_H
#include "dictionary.H"
#include "pointFieldFwd.H"
#include "Tuple2.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -69,8 +69,8 @@ protected:
//- On/off switch - on if obr_ is an fvMesh object
bool active_;
//- List of variable name vs max residual
List<Tuple2<word, scalar> > maxResiduals_;
//- Dictionary of variable names vs max residual
dictionary maxResiduals_;
//- Flag to indicate whether convergence criteria have been met
bool criteriaSatisfied_;
@ -79,7 +79,7 @@ protected:
// Protected Member Functions
//- Perform residual control checks
bool checkCriteria(const bool output) const;
bool checkCriteria(const bool verbose) const;
//- Disallow default bitwise copy construct
residualControl(const residualControl&);
@ -113,7 +113,7 @@ public:
// Member Functions
//- Return name of the system call set
//- Return name of the residual criteria check name
virtual const word& name() const
{
return name_;
@ -122,13 +122,13 @@ public:
//- Read the system calls
virtual void read(const dictionary&);
//- Execute the "executeCalls" at each time-step
//- Check the residual criteria at each time-step
virtual void execute();
//- Execute the "endCalls" at the final time-loop
//- Report residual criteria check at the final time-loop
virtual void end();
//- Write, execute the "writeCalls"
//- Write, not used
virtual void write();
//- Update for changes of mesh

View File

@ -1,4 +0,0 @@
residualControl.C
residualControlFunctionObject.C
LIB = $(FOAM_LIBBIN)/libresidualControl

View File

@ -29,10 +29,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(systemCall, 0);
}
defineTypeNameAndDebug(Foam::systemCall, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -1,6 +1,3 @@
abortCalculation/abortCalculation.C
abortCalculation/abortCalculationFunctionObject.C
staticPressure/staticPressure.C
staticPressure/staticPressureFunctionObject.C

View File

@ -34,10 +34,7 @@ using namespace Foam::constant;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(dsmcFields, 0);
}
defineTypeNameAndDebug(Foam::dsmcFields, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -29,10 +29,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(staticPressure, 0);
}
defineTypeNameAndDebug(Foam::staticPressure, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -37,29 +37,30 @@ writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
runTimeModifiable true;
functions
{
fileUpdate1
{
type timeActivatedFileUpdate;
type timeActivatedFileUpdate;
functionObjectLibs ("libutilityFunctionObjects.so");
outputControl timeStep;
outputInterval 1;
fileToUpdate "$FOAM_CASE/system/fvSolution";
outputControl timeStep;
outputInterval 1;
fileToUpdate "$FOAM_CASE/system/fvSolution";
timeVsFile
(
(-1 "$FOAM_CASE/system/fvSolution.0")
(0.10 "$FOAM_CASE/system/fvSolution.10")
(0.20 "$FOAM_CASE/system/fvSolution.20")
(0.35 "$FOAM_CASE/system/fvSolution.35")
( -1 "$FOAM_CASE/system/fvSolution.0" )
( 0.10 "$FOAM_CASE/system/fvSolution.10" )
( 0.20 "$FOAM_CASE/system/fvSolution.20" )
( 0.35 "$FOAM_CASE/system/fvSolution.35" )
);
}
}

View File

@ -30,10 +30,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(timeActivatedFileUpdate, 0);
}
defineTypeNameAndDebug(Foam::timeActivatedFileUpdate, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -36,10 +36,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(isoSurface, 0);
}
defineTypeNameAndDebug(Foam::isoSurface, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -34,10 +34,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(isoSurfaceCell, 0);
}
defineTypeNameAndDebug(Foam::isoSurfaceCell, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //