This function object creates a size distribution via interrogating a continuous phase fraction field. More...
Public Member Functions | |
TypeName ("regionSizeDistribution") | |
Runtime type information. More... | |
regionSizeDistribution (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false) | |
Construct for given objectRegistry and dictionary. More... | |
virtual | ~regionSizeDistribution () |
virtual const word & | name () const |
Return name of the set of regionSizeDistribution. More... | |
virtual void | read (const dictionary &) |
Read the regionSizeDistribution data. More... | |
virtual void | execute () |
Execute, currently does nothing. More... | |
virtual void | end () |
Execute at the final time-loop, currently does nothing. More... | |
virtual void | timeSet () |
Called when time was set at the end of the Time::operator++. More... | |
virtual void | write () |
Calculate the regionSizeDistribution and write. More... | |
virtual void | updateMesh (const mapPolyMesh &) |
Update for changes of mesh. More... | |
virtual void | movePoints (const polyMesh &) |
Update for changes of mesh. More... | |
template<class Type > | |
Foam::Map< Type > | regionSum (const regionSplit ®ions, const Field< Type > &fld) const |
template<class Type > | |
Foam::List< Type > | extractData (const UList< label > &keys, const Map< Type > ®ionData) const |
![]() | |
functionObjectFile (const objectRegistry &obr, const word &prefix) | |
Construct null. More... | |
functionObjectFile (const objectRegistry &obr, const word &prefix, const word &fileName, const dictionary &dict) | |
Construct from components and read options from dictionary. More... | |
virtual | ~functionObjectFile () |
Destructor. More... | |
void | read (const dictionary &dict) |
Read. More... | |
OFstream & | file () |
Return access to the file (if only 1) More... | |
bool | writeToFile () const |
Return true if can write to file. More... | |
void | writeCommented (Ostream &os, const string &str) const |
Write a commented string to stream. More... | |
void | writeTabbed (Ostream &os, const string &str) const |
Write a tabbed string to stream. More... | |
void | writeHeader (Ostream &os, const string &str) const |
Write a commented header to stream. More... | |
void | writeTime (Ostream &os) const |
Write the current time to stream. More... | |
template<class Type > | |
void | writeHeaderValue (Ostream &os, const string &property, const Type &value) const |
Write a (commented) header property and value pair. More... | |
label | charWidth () const |
Return width of character stream output. More... | |
Private Member Functions | |
template<class Type > | |
Map< Type > | regionSum (const regionSplit &, const Field< Type > &) const |
template<class Type > | |
List< Type > | extractData (const UList< label > &keys, const Map< Type > &) const |
Get data in order. More... | |
void | writeGraph (const coordSet &coords, const word &valueName, const scalarField &values) const |
void | writeAlphaFields (const regionSplit ®ions, const Map< label > &keepRegions, const Map< scalar > ®ionVolume, const volScalarField &alpha) const |
Write volfields with the parts of alpha which are not. More... | |
Map< label > | findPatchRegions (const polyMesh &, const regionSplit &) const |
Mark all regions starting at patches. More... | |
void | writeGraphs (const word &fieldName, const labelList &indices, const scalarField &sortedField, const scalarField &binCount, const coordSet &coords) const |
Given per-region data calculate per-bin average/deviation and graph. More... | |
void | writeGraphs (const word &fieldName, const scalarField &cellField, const regionSplit ®ions, const labelList &sortedRegions, const scalarField &sortedNormalisation, const labelList &indices, const scalarField &binCount, const coordSet &coords) const |
Given per-cell data calculate per-bin average/deviation and graph. More... | |
regionSizeDistribution (const regionSizeDistribution &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const regionSizeDistribution &) |
Disallow default bitwise assignment. More... | |
Static Private Member Functions | |
static tmp< scalarField > | divide (const scalarField &, const scalarField &) |
Helper: divide if denom != 0. More... | |
Private Attributes | |
word | name_ |
Name of this set of regionSizeDistribution objects. More... | |
const objectRegistry & | obr_ |
bool | active_ |
on/off switch More... | |
word | alphaName_ |
Name of field. More... | |
wordReList | patchNames_ |
Patches to walk from. More... | |
Switch | log_ |
Switch to send output to Info as well as to file. More... | |
scalar | threshold_ |
Clip value. More... | |
scalar | maxDiam_ |
Maximum droplet diameter. More... | |
scalar | minDiam_ |
Minimum droplet diameter. More... | |
label | nBins_ |
Mumber of bins. More... | |
wordReList | fields_ |
Names of fields to sample on regions. More... | |
autoPtr< writer< scalar > > | formatterPtr_ |
Output formatter to write. More... | |
autoPtr< coordinateSystem > | coordSysPtr_ |
Optional coordinate system. More... | |
Additional Inherited Members | |
![]() | |
static const word | outputPrefix = "postProcessing" |
Directory prefix. More... | |
static label | addChars = 7 |
Additional characters for writing. More... | |
![]() | |
virtual void | initStream (Ostream &os) const |
Initialise the output stream for writing. More... | |
virtual fileName | baseFileDir () const |
Return the base directory for output. More... | |
virtual fileName | baseTimeDir () const |
Return the base directory for the current time value. More... | |
virtual autoPtr< OFstream > | createFile (const word &name) const |
Return an autoPtr to a new file. More... | |
virtual void | resetFile (const word &name) |
Reset internal file pointer to new file with new name. More... | |
virtual Omanip< int > | valueWidth (const label offset=0) const |
Return the value width when writing to stream with optional offset. More... | |
functionObjectFile (const functionObjectFile &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const functionObjectFile &) |
Disallow default bitwise assignment. More... | |
![]() | |
bool | writeToFile_ |
Flag to enable/disable writing to file. More... | |
This function object creates a size distribution via interrogating a continuous phase fraction field.
Looks up a phase-fraction (alpha) field and splits the mesh into regions based on where the field is below the threshold value. These regions ("droplets") can now be analysed.
Regions:
Output (volume scalar) fields include:
Histogram:
Example of function object specification:
regionSizeDistribution1 { type regionSizeDistribution; functionObjectLibs ("libfieldFunctionObjects.so"); ... field alpha; patches (inlet); threshold 0.4; fields (p U); nBins 100; maxDiameter 0.5e-4; minDiameter 0; setFormat gnuplot; coordinateSystem { type cartesian; origin (0 0 0); e3 (0 1 1); e1 (1 0 0); } }
Function object usage
Property | Description | Required | Default value |
---|---|---|---|
type | type name: regionSizeDistribution | yes | |
field | phase field to interrogate | yes | |
patches | patches from which the liquid core is identified | yes | |
threshold | phase fraction applied to delimit regions | yes | |
fields | fields to sample | yes | |
nBins | number of bins for histogram | yes | |
maxDiameter | maximum region equivalent diameter | yes | |
minDiameter | minimum region equivalent diameter | no | 0 |
setFormat | writing format | yes | |
coordinateSystem | transformation for vector fields | no | |
log | Log to standard output | no | yes |
Definition at line 194 of file regionSizeDistribution.H.
|
private |
Disallow default bitwise copy construct.
regionSizeDistribution | ( | const word & | name, |
const objectRegistry & | obr, | ||
const dictionary & | dict, | ||
const bool | loadFromFiles = false |
||
) |
Construct for given objectRegistry and dictionary.
Allow the possibility to load fields from files
Definition at line 325 of file regionSizeDistribution.C.
References dict, Foam::endl(), Foam::nl, Foam::read(), and WarningInFunction.
|
virtual |
Definition at line 357 of file regionSizeDistribution.C.
|
private |
Get data in order.
|
private |
Definition at line 62 of file regionSizeDistribution.C.
References Foam::endl(), Foam::Info, Foam::mkDir(), and OFstream::name().
|
private |
Write volfields with the parts of alpha which are not.
droplets (liquidCore, backGround)
Definition at line 86 of file regionSizeDistribution.C.
References Foam::constant::atomic::alpha, GeometricField::correctBoundaryConditions(), Foam::fvc::domainIntegrate(), Foam::endl(), forAll, Foam::Info, Foam::pow(), and dimensioned::value().
|
private |
Mark all regions starting at patches.
Definition at line 174 of file regionSizeDistribution.C.
References polyPatch::faceCells(), forAll, forAllConstIter(), and mesh.
|
staticprivate |
Helper: divide if denom != 0.
Definition at line 220 of file regionSizeDistribution.C.
References forAll, and scalarField().
|
private |
Given per-region data calculate per-bin average/deviation and graph.
Definition at line 244 of file regionSizeDistribution.C.
References Foam::divide(), forAll, Foam::sqr(), and Foam::sqrt().
|
private |
Given per-cell data calculate per-bin average/deviation and graph.
Definition at line 285 of file regionSizeDistribution.C.
|
private |
Disallow default bitwise assignment.
TypeName | ( | "regionSizeDistribution" | ) |
Runtime type information.
|
inlinevirtual |
Return name of the set of regionSizeDistribution.
Definition at line 331 of file regionSizeDistribution.H.
References regionSizeDistribution::name_.
|
virtual |
Read the regionSizeDistribution data.
Definition at line 363 of file regionSizeDistribution.C.
References dict, Foam::endl(), format(), dictionary::found(), Foam::Info, dictionary::lookup(), writer< Type >::New(), functionObjectFile::read(), and dictionary::readIfPresent().
|
virtual |
Execute, currently does nothing.
Definition at line 395 of file regionSizeDistribution.C.
|
virtual |
Execute at the final time-loop, currently does nothing.
Definition at line 401 of file regionSizeDistribution.C.
|
virtual |
Called when time was set at the end of the Time::operator++.
Definition at line 407 of file regionSizeDistribution.C.
|
virtual |
Calculate the regionSizeDistribution and write.
Definition at line 413 of file regionSizeDistribution.C.
References Foam::constant::atomic::alpha, alphaPtr, Foam::cbrt(), Vector< scalar >::componentNames, GeometricField::correctBoundaryConditions(), fvPatchField::coupled(), delta, Foam::dimless, Foam::fvc::domainIntegrate(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), Foam::findStrings(), fld(), forAll, forAllConstIter(), forAllIter, Foam::gSum(), Foam::Info, internalField(), HashTable::iteratorBase::key(), Foam::mag(), UPstream::master(), mesh, IOobject::MUST_READ, dimensioned::name(), primitiveMesh::nCells(), VectorSpace< Vector< scalar >, scalar, 3 >::nComponents, primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, IOobject::NO_READ, IOobject::NO_WRITE, regionSplit::nRegions(), fvPatch::patch(), fvPatchField::patch(), fvPatchField::patchInternalField(), fvPatchField::patchNeighbourField(), Foam::constant::mathematical::pi(), Foam::pow(), polyPatch::start(), token::TAB, fvMesh::time(), Time::timeName(), Foam::type(), fvMesh::V(), dimensioned::value(), and x.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 352 of file regionSizeDistribution.H.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 356 of file regionSizeDistribution.H.
Foam::Map<Type> regionSum | ( | const regionSplit & | regions, |
const Field< Type > & | fld | ||
) | const |
Definition at line 34 of file regionSizeDistributionTemplates.C.
References fld(), forAll, and regionSplit::nRegions().
Foam::List<Type> extractData | ( | const UList< label > & | keys, |
const Map< Type > & | regionData | ||
) | const |
Definition at line 66 of file regionSizeDistributionTemplates.C.
References forAll, and UList::size().
|
private |
Name of this set of regionSizeDistribution objects.
Definition at line 201 of file regionSizeDistribution.H.
Referenced by regionSizeDistribution::name().
|
private |
Definition at line 203 of file regionSizeDistribution.H.
|
private |
on/off switch
Definition at line 206 of file regionSizeDistribution.H.
|
private |
Name of field.
Definition at line 209 of file regionSizeDistribution.H.
|
private |
Patches to walk from.
Definition at line 212 of file regionSizeDistribution.H.
|
private |
Switch to send output to Info as well as to file.
Definition at line 215 of file regionSizeDistribution.H.
|
private |
Clip value.
Definition at line 218 of file regionSizeDistribution.H.
|
private |
Maximum droplet diameter.
Definition at line 221 of file regionSizeDistribution.H.
|
private |
Minimum droplet diameter.
Definition at line 224 of file regionSizeDistribution.H.
|
private |
Mumber of bins.
Definition at line 227 of file regionSizeDistribution.H.
|
private |
Names of fields to sample on regions.
Definition at line 230 of file regionSizeDistribution.H.
Output formatter to write.
Definition at line 233 of file regionSizeDistribution.H.
|
private |
Optional coordinate system.
Definition at line 236 of file regionSizeDistribution.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.