Commit f8aa06d1 authored by henry's avatar henry
Browse files
parents 3ac92339 d1f908df
......@@ -151,18 +151,20 @@ public:
const IOobject& fieldIoObject
);
//- Reconstruct and write all volume fields
//- Reconstruct and write all/selected volume fields
template<class Type>
void reconstructFvVolumeFields
(
const IOobjectList& objects
const IOobjectList& objects,
const HashSet<word>& selectedFields
);
//- Reconstruct and write all volume fields
//- Reconstruct and write all/selected volume fields
template<class Type>
void reconstructFvSurfaceFields
(
const IOobjectList& objects
const IOobjectList& objects,
const HashSet<word>& selectedFields
);
};
......
......@@ -131,7 +131,7 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField
forAll(cp, faceI)
{
// Subtract one to take into account offsets for
// face direction.
// face direction.
reverseAddressing[faceI] = cp[faceI] - 1 - curPatchStart;
}
......@@ -151,7 +151,7 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField
forAll(cp, faceI)
{
// Subtract one to take into account offsets for
// face direction.
// face direction.
label curF = cp[faceI] - 1;
// Is the face on the boundary?
......@@ -282,7 +282,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
// It is necessary to create a copy of the addressing array to
// take care of the face direction offset trick.
//
//
{
labelList curAddr(faceProcAddressing_[procI]);
......@@ -342,7 +342,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
forAll(cp, faceI)
{
// Subtract one to take into account offsets for
// face direction.
// face direction.
reverseAddressing[faceI] = cp[faceI] - 1 - curPatchStart;
}
......@@ -452,11 +452,12 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
}
// Reconstruct and write all volume fields
// Reconstruct and write all/selected volume fields
template<class Type>
void Foam::fvFieldReconstructor::reconstructFvVolumeFields
(
const IOobjectList& objects
const IOobjectList& objects,
const HashSet<word>& selectedFields
)
{
const word& fieldClassName =
......@@ -468,27 +469,29 @@ void Foam::fvFieldReconstructor::reconstructFvVolumeFields
{
Info<< " Reconstructing " << fieldClassName << "s\n" << endl;
for
(
IOobjectList::const_iterator fieldIter = fields.begin();
fieldIter != fields.end();
++fieldIter
)
forAllConstIter(IOobjectList, fields, fieldIter)
{
Info<< " " << fieldIter()->name() << endl;
if
(
!selectedFields.size()
|| selectedFields.found(fieldIter()->name())
)
{
Info<< " " << fieldIter()->name() << endl;
reconstructFvVolumeField<Type>(*fieldIter())().write();
reconstructFvVolumeField<Type>(*fieldIter())().write();
}
}
Info<< endl;
}
}
// Reconstruct and write all surface fields
// Reconstruct and write all/selected surface fields
template<class Type>
void Foam::fvFieldReconstructor::reconstructFvSurfaceFields
(
const IOobjectList& objects
const IOobjectList& objects,
const HashSet<word>& selectedFields
)
{
const word& fieldClassName =
......@@ -500,18 +503,19 @@ void Foam::fvFieldReconstructor::reconstructFvSurfaceFields
{
Info<< " Reconstructing " << fieldClassName << "s\n" << endl;
for
(
IOobjectList::const_iterator fieldIter = fields.begin();
fieldIter != fields.end();
++fieldIter
)
forAllConstIter(IOobjectList, fields, fieldIter)
{
Info<< " " << fieldIter()->name() << endl;
if
(
!selectedFields.size()
|| selectedFields.found(fieldIter()->name())
)
{
Info<< " " << fieldIter()->name() << endl;
reconstructFvSurfaceField<Type>(*fieldIter())().write();
reconstructFvSurfaceField<Type>(*fieldIter())().write();
}
}
Info<< endl;
}
}
......
......@@ -48,9 +48,17 @@ int main(int argc, char *argv[])
argList::noParallel();
timeSelector::addOptions();
# include "addRegionOption.H"
argList::validOptions.insert("fields", "\"(list of fields)\"");
# include "setRootCase.H"
# include "createTime.H"
HashSet<word> selectedFields;
if (args.options().found("fields"))
{
IStringStream(args.options()["fields"])() >> selectedFields;
}
// determine the processor count directly
label nProcs = 0;
while (dir(args.path()/(word("processor") + name(nProcs))))
......@@ -184,13 +192,37 @@ int main(int argc, char *argv[])
procMeshes.boundaryProcAddressing()
);
fvReconstructor.reconstructFvVolumeFields<scalar>(objects);
fvReconstructor.reconstructFvVolumeFields<vector>(objects);
fvReconstructor.reconstructFvVolumeFields<sphericalTensor>(objects);
fvReconstructor.reconstructFvVolumeFields<symmTensor>(objects);
fvReconstructor.reconstructFvVolumeFields<tensor>(objects);
fvReconstructor.reconstructFvVolumeFields<scalar>
(
objects,
selectedFields
);
fvReconstructor.reconstructFvVolumeFields<vector>
(
objects,
selectedFields
);
fvReconstructor.reconstructFvVolumeFields<sphericalTensor>
(
objects,
selectedFields
);
fvReconstructor.reconstructFvVolumeFields<symmTensor>
(
objects,
selectedFields
);
fvReconstructor.reconstructFvVolumeFields<tensor>
(
objects,
selectedFields
);
fvReconstructor.reconstructFvSurfaceFields<scalar>(objects);
fvReconstructor.reconstructFvSurfaceFields<scalar>
(
objects,
selectedFields
);
}
else
{
......
......@@ -160,7 +160,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
scalar yPlus = Cmu25*y[faceI]*sqrt(k[faceCellI])/nuw[faceI];
omega[faceCellI] = sqrt(k[faceCellI])/(Cmu25*kappa*y[faceCellI]);
omega[faceCellI] = sqrt(k[faceCellI])/(Cmu25*kappa*y[faceI]);
if (yPlus > yPlusLam)
{
......@@ -168,7 +168,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
(nutw[faceI] + nuw[faceI])
*magGradUw[faceI]
*Cmu25*sqrt(k[faceCellI])
/(kappa*y[faceCellI]);
/(kappa*y[faceI]);
}
else
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment