mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge commit 'OpenCFD/master' into olesenm
This commit is contained in:
@ -154,100 +154,6 @@ void insertDuplicateMerge
|
||||
}
|
||||
|
||||
|
||||
// Get points on the inside of baffle regions.
|
||||
labelList getNonManifoldPointsInsideBaffles
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const labelList& baffleFaces
|
||||
)
|
||||
{
|
||||
// Get points to split. These are the edges of the duplicate-faces
|
||||
// region
|
||||
|
||||
indirectPrimitivePatch dupPatch
|
||||
(
|
||||
IndirectList<face>(mesh.faces(), baffleFaces),
|
||||
mesh.points()
|
||||
);
|
||||
|
||||
labelHashSet insideSet(dupPatch.nPoints());
|
||||
|
||||
// Pick up all points but the ones on the edge of the region.
|
||||
// Edge of the region since has two faces along edge.
|
||||
|
||||
forAll(dupPatch.meshPoints(), i)
|
||||
{
|
||||
insideSet.insert(dupPatch.meshPoints()[i]);
|
||||
}
|
||||
forAll(dupPatch.edgeFaces(), edgeI)
|
||||
{
|
||||
const labelList& eFaces = dupPatch.edgeFaces()[edgeI];
|
||||
|
||||
if (eFaces.size() == 2)
|
||||
{
|
||||
const edge& e = dupPatch.edges()[edgeI];
|
||||
|
||||
insideSet.erase(dupPatch.meshPoints()[e[0]]);
|
||||
insideSet.erase(dupPatch.meshPoints()[e[1]]);
|
||||
}
|
||||
}
|
||||
|
||||
return insideSet.toc();
|
||||
}
|
||||
|
||||
|
||||
// Find all non-manifold points on the outside of the mesh.
|
||||
labelList getAllNonManifoldPoints
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelList& boundaryFaces
|
||||
)
|
||||
{
|
||||
indirectPrimitivePatch allOutside
|
||||
(
|
||||
IndirectList<face>(mesh.faces(), boundaryFaces),
|
||||
mesh.points()
|
||||
);
|
||||
|
||||
// All points on non-manifold edges.
|
||||
boolList nonManifoldPoint(mesh.nPoints(), false);
|
||||
|
||||
forAll(allOutside.meshPoints(), localPointI)
|
||||
{
|
||||
label pointI = allOutside.meshPoints()[localPointI];
|
||||
|
||||
if (!localPointRegion::isSingleCellRegion(mesh, pointI))
|
||||
{
|
||||
nonManifoldPoint[pointI] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Splittable only if all processors decide to split it.
|
||||
syncTools::syncPointList
|
||||
(
|
||||
mesh,
|
||||
nonManifoldPoint,
|
||||
andEqOp<bool>(), // combineop
|
||||
true, // null value
|
||||
false // no separation
|
||||
);
|
||||
|
||||
// Extract 'true' elements
|
||||
labelList nonManifPoints(findIndices(nonManifoldPoint, true));
|
||||
|
||||
// Write to pointSet for ease of postprocessing
|
||||
pointSet nonManifPointSet(mesh, "nonManifoldPoints", nonManifPoints);
|
||||
|
||||
Pout<< "Writing " << nonManifPointSet.size()
|
||||
<< " non-manif points to " << nonManifPointSet.objectPath()
|
||||
<< endl;
|
||||
|
||||
nonManifPointSet.write();
|
||||
|
||||
return nonManifPoints;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::validOptions.insert("split", "");
|
||||
@ -316,26 +222,14 @@ int main(int argc, char *argv[])
|
||||
<< ", i.e. duplicating points internal to duplicate surfaces."
|
||||
<< nl << endl;
|
||||
|
||||
labelList nonManifPoints
|
||||
(
|
||||
getAllNonManifoldPoints
|
||||
(
|
||||
mesh,
|
||||
boundaryFaces
|
||||
)
|
||||
);
|
||||
|
||||
// Analyse which points need to be duplicated
|
||||
localPointRegion regionSide(mesh, nonManifPoints);
|
||||
localPointRegion regionSide(mesh);
|
||||
|
||||
// Point duplication engine
|
||||
duplicatePoints pointDuplicator(mesh);
|
||||
|
||||
pointDuplicator.setRefinement
|
||||
(
|
||||
nonManifPoints,
|
||||
regionSide,
|
||||
meshMod
|
||||
);
|
||||
// Insert topo changes
|
||||
pointDuplicator.setRefinement(regionSide, meshMod);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -762,7 +762,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Pout<< "Please type 'help', 'quit' or a set command after prompt." << endl;
|
||||
|
||||
bool ok = false;
|
||||
bool ok = true;
|
||||
|
||||
FatalError.throwExceptions();
|
||||
FatalIOError.throwExceptions();
|
||||
|
||||
@ -64,7 +64,7 @@ SourceFiles
|
||||
#include "fileName.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "stringList.H"
|
||||
|
||||
#include "primitivePatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
|
||||
|
||||
@ -449,6 +449,7 @@ private:
|
||||
(
|
||||
const fvMesh&,
|
||||
const volPointInterpolation& pInterp,
|
||||
const PtrList<PrimitivePatchInterpolation<primitivePatch> >&,
|
||||
const IOobjectList& objects,
|
||||
vtkDataArraySelection* fieldSelection,
|
||||
vtkMultiBlockDataSet* output
|
||||
|
||||
@ -45,6 +45,7 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const volPointInterpolation& pInterp,
|
||||
const PtrList<PrimitivePatchInterpolation<primitivePatch> >& ppInterpList,
|
||||
const IOobjectList& objects,
|
||||
vtkDataArraySelection *fieldSelection,
|
||||
vtkMultiBlockDataSet* output
|
||||
@ -153,7 +154,6 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
tf.boundaryField()[patchId]
|
||||
);
|
||||
|
||||
|
||||
if
|
||||
(
|
||||
isType<emptyFvPatchField<Type> >(ptf)
|
||||
@ -195,8 +195,7 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
convertPatchPointField
|
||||
(
|
||||
tf.name(),
|
||||
tptf().boundaryField()[patchId]
|
||||
.patchInternalField()(),
|
||||
ppInterpList[patchId].faceToPointInterpolate(ptf)(),
|
||||
output,
|
||||
selectInfoPatches_,
|
||||
selectedRegionDatasetIds_[regionId]
|
||||
|
||||
@ -122,6 +122,21 @@ void Foam::vtkPV3Foam::updateVolFields
|
||||
}
|
||||
|
||||
volPointInterpolation pInterp(mesh, pMesh);
|
||||
|
||||
PtrList<PrimitivePatchInterpolation<primitivePatch> >
|
||||
ppInterpList(mesh.boundaryMesh().size());
|
||||
|
||||
forAll(ppInterpList, i)
|
||||
{
|
||||
ppInterpList.set
|
||||
(
|
||||
i,
|
||||
new PrimitivePatchInterpolation<primitivePatch>
|
||||
(
|
||||
mesh.boundaryMesh()[i]
|
||||
)
|
||||
);
|
||||
}
|
||||
/*
|
||||
convertVolFields<Foam::label>
|
||||
(
|
||||
@ -130,23 +145,23 @@ void Foam::vtkPV3Foam::updateVolFields
|
||||
*/
|
||||
convertVolFields<Foam::scalar>
|
||||
(
|
||||
mesh, pInterp, objects, arraySelection, output
|
||||
mesh, pInterp, ppInterpList, objects, arraySelection, output
|
||||
);
|
||||
convertVolFields<Foam::vector>
|
||||
(
|
||||
mesh, pInterp, objects, arraySelection, output
|
||||
mesh, pInterp, ppInterpList, objects, arraySelection, output
|
||||
);
|
||||
convertVolFields<Foam::sphericalTensor>
|
||||
(
|
||||
mesh, pInterp, objects, arraySelection, output
|
||||
mesh, pInterp, ppInterpList, objects, arraySelection, output
|
||||
);
|
||||
convertVolFields<Foam::symmTensor>
|
||||
(
|
||||
mesh, pInterp, objects, arraySelection, output
|
||||
mesh, pInterp, ppInterpList, objects, arraySelection, output
|
||||
);
|
||||
convertVolFields<Foam::tensor>
|
||||
(
|
||||
mesh, pInterp, objects, arraySelection, output
|
||||
mesh, pInterp, ppInterpList, objects, arraySelection, output
|
||||
);
|
||||
|
||||
if (debug)
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
/*
|
||||
volTensorField gradU = fvc::grad(U);
|
||||
volSymmTensorField D = symm(fvc::grad(U));
|
||||
volTensorField Dprim = symm(fvc::grad(U - Umean));
|
||||
volTensorField Dprim = symm(fvc::grad(U - UMean));
|
||||
|
||||
volScalarField prod = -((U - Umean)*(U - Umean)) && D;
|
||||
volScalarField prod = -((U - UMean)*(U - UMean)) && D;
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -20,7 +20,7 @@
|
||||
mesh,
|
||||
dimensionSet(0, 1, -1, 0, 0)
|
||||
);
|
||||
txx =sqrt(Txx - (Umeanx*Umeanx));
|
||||
txx =sqrt(Txx - (UMeanx*UMeanx));
|
||||
txx.write();
|
||||
|
||||
volScalarField tyy
|
||||
@ -36,7 +36,7 @@
|
||||
mesh,
|
||||
dimensionSet(0, 1, -1, 0, 0)
|
||||
);
|
||||
tyy = sqrt(Tyy - (Umeany*Umeany));
|
||||
tyy = sqrt(Tyy - (UMeany*UMeany));
|
||||
tyy.write();
|
||||
|
||||
volScalarField tzz
|
||||
@ -52,7 +52,7 @@
|
||||
mesh,
|
||||
dimensionSet(0, 1, -1, 0, 0)
|
||||
);
|
||||
tzz = sqrt(Tzz - (Umeanz*Umeanz));
|
||||
tzz = sqrt(Tzz - (UMeanz*UMeanz));
|
||||
tzz.write();
|
||||
|
||||
volScalarField txy
|
||||
@ -68,6 +68,6 @@
|
||||
mesh,
|
||||
dimensionSet(0, 2, -2, 0, 0)
|
||||
);
|
||||
txy = Txy - (Umeanx*Umeany);
|
||||
txy = Txy - (UMeanx*UMeany);
|
||||
txy.write();
|
||||
*/
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
scalarField UmeanXvalues = channelIndexing.collapse
|
||||
scalarField UMeanXvalues = channelIndexing.collapse
|
||||
(
|
||||
Umean.component(vector::X)
|
||||
UMean.component(vector::X)
|
||||
);
|
||||
|
||||
scalarField UmeanYvalues = channelIndexing.collapse
|
||||
scalarField UMeanYvalues = channelIndexing.collapse
|
||||
(
|
||||
Umean.component(vector::Y)
|
||||
UMean.component(vector::Y)
|
||||
);
|
||||
|
||||
scalarField UmeanZvalues = channelIndexing.collapse
|
||||
scalarField UMeanZvalues = channelIndexing.collapse
|
||||
(
|
||||
Umean.component(vector::Z)
|
||||
UMean.component(vector::Z)
|
||||
);
|
||||
|
||||
scalarField RxxValues = channelIndexing.collapse(Rxx);
|
||||
@ -20,9 +20,9 @@
|
||||
|
||||
scalarField pPrime2MeanValues = channelIndexing.collapse(pPrime2Mean);
|
||||
|
||||
/*
|
||||
scalarField epsilonValues = channelIndexing.collapse(epsilonMean);
|
||||
|
||||
/*
|
||||
scalarField nuMeanValues = channelIndexing.collapse(nuMean);
|
||||
scalarField nuPrimeValues = channelIndexing.collapse(nuPrime);
|
||||
|
||||
@ -34,27 +34,25 @@
|
||||
scalarField vrmsValues = sqrt(mag(RyyValues));
|
||||
scalarField wrmsValues = sqrt(mag(RzzValues));
|
||||
|
||||
scalarField kValues
|
||||
= 0.5*(sqr(urmsValues) + sqr(vrmsValues) + sqr(wrmsValues));
|
||||
|
||||
scalarField kValues =
|
||||
0.5*(sqr(urmsValues) + sqr(vrmsValues) + sqr(wrmsValues));
|
||||
|
||||
|
||||
scalarField y = channelIndexing.y(mesh.C());
|
||||
|
||||
makeGraph(y, UmeanXvalues, "Uf", R.path(), gFormat);
|
||||
makeGraph(y, urmsValues, "u", R.path(), gFormat);
|
||||
makeGraph(y, vrmsValues, "v", R.path(), gFormat);
|
||||
makeGraph(y, wrmsValues, "w", R.path(), gFormat);
|
||||
makeGraph(y, RxyValues, "uv", R.path(), gFormat);
|
||||
makeGraph(y, kValues, "k", R.path(), gFormat);
|
||||
makeGraph(y, UMeanXvalues, "Uf", UMean.path(), gFormat);
|
||||
makeGraph(y, urmsValues, "u", UMean.path(), gFormat);
|
||||
makeGraph(y, vrmsValues, "v", UMean.path(), gFormat);
|
||||
makeGraph(y, wrmsValues, "w", UMean.path(), gFormat);
|
||||
makeGraph(y, RxyValues, "uv", UMean.path(), gFormat);
|
||||
makeGraph(y, kValues, "k", UMean.path(), gFormat);
|
||||
|
||||
makeGraph(y, pPrime2MeanValues, "pPrime2Mean", R.path(), gFormat);
|
||||
|
||||
makeGraph(y, epsilonValues, "epsilon", R.path(), gFormat);
|
||||
makeGraph(y, pPrime2MeanValues, "pPrime2Mean", UMean.path(), gFormat);
|
||||
|
||||
/*
|
||||
makeGraph(y, nuMeanValues, "nu", R.path(), gFormat);
|
||||
makeGraph(y, nuPrimeValues, "nuPrime", R.path(), gFormat);
|
||||
makeGraph(y, gammaDotMeanValues, "gammaDot", R.path(), gFormat);
|
||||
makeGraph(y, gammaDotPrimeValues, "gammaDotPrime", R.path(), gFormat);
|
||||
makeGraph(y, epsilonValues, "epsilon", UMean.path(), gFormat);
|
||||
makeGraph(y, nuMeanValues, "nu", UMean.path(), gFormat);
|
||||
makeGraph(y, nuPrimeValues, "nuPrime", UMean.path(), gFormat);
|
||||
makeGraph(y, gammaDotMeanValues, "gammaDot", UMean.path(), gFormat);
|
||||
makeGraph(y, gammaDotPrimeValues, "gammaDotPrime", UMean.path(), gFormat);
|
||||
*/
|
||||
|
||||
@ -1,37 +1,38 @@
|
||||
IOobject UmeanHeader
|
||||
IOobject UMeanHeader
|
||||
(
|
||||
"Umean",
|
||||
"UMean",
|
||||
runTime.times()[i].name(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
if (!UmeanHeader.headerOk())
|
||||
if (!UMeanHeader.headerOk())
|
||||
{
|
||||
Info<< " No UMean field" << endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
volVectorField Umean
|
||||
volVectorField UMean
|
||||
(
|
||||
UmeanHeader,
|
||||
UMeanHeader,
|
||||
mesh
|
||||
);
|
||||
|
||||
volSymmTensorField R
|
||||
volSymmTensorField UPrime2Mean
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
"UPrime2Mean",
|
||||
runTime.times()[i].name(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
);
|
||||
volScalarField Rxx(R.component(symmTensor::XX));
|
||||
volScalarField Ryy(R.component(symmTensor::YY));
|
||||
volScalarField Rzz(R.component(symmTensor::ZZ));
|
||||
volScalarField Rxy(R.component(symmTensor::XY));
|
||||
volScalarField Rxx(UPrime2Mean.component(symmTensor::XX));
|
||||
volScalarField Ryy(UPrime2Mean.component(symmTensor::YY));
|
||||
volScalarField Rzz(UPrime2Mean.component(symmTensor::ZZ));
|
||||
volScalarField Rxy(UPrime2Mean.component(symmTensor::XY));
|
||||
|
||||
volScalarField pPrime2Mean
|
||||
(
|
||||
@ -45,6 +46,7 @@
|
||||
mesh
|
||||
);
|
||||
|
||||
/*
|
||||
volScalarField epsilonMean
|
||||
(
|
||||
IOobject
|
||||
@ -57,7 +59,6 @@
|
||||
mesh
|
||||
);
|
||||
|
||||
/*
|
||||
volScalarField nuMean
|
||||
(
|
||||
IOobject
|
||||
|
||||
Reference in New Issue
Block a user