mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -38,7 +38,8 @@ Foam::scalar Foam::compressibleCourantNo
|
||||
scalar CoNum = 0.0;
|
||||
scalar meanCoNum = 0.0;
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
//- Can have fluid domains with 0 cells so do not test.
|
||||
//if (mesh.nInternalFaces())
|
||||
{
|
||||
surfaceScalarField SfUfbyDelta =
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
|
||||
@ -131,6 +131,12 @@ castellatedMeshControls
|
||||
level (3 3);
|
||||
}
|
||||
}
|
||||
|
||||
// Optional angle to detect small-large cell situation perpendicular
|
||||
// to the surface. Is the angle of face w.r.t the local surface
|
||||
// normal. Use on flat(ish) surfaces only. Otherwise
|
||||
// leave out or set to negative number.
|
||||
//perpendicularAngle 10;
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,9 +323,10 @@ meshQualityControls
|
||||
minTriangleTwist -1;
|
||||
|
||||
//- if >0 : preserve single cells with all points on the surface if the
|
||||
// resulting volume after snapping is larger than minVolFraction times old
|
||||
// volume. If <0 : delete always.
|
||||
minVolFraction 0.1;
|
||||
// resulting volume after snapping (by approximation) is larger than
|
||||
// minVolCollapseRatio times old volume (i.e. not collapsed to flat cell).
|
||||
// If <0 : delete always.
|
||||
//minVolCollapseRatio 0.5;
|
||||
|
||||
|
||||
// Advanced
|
||||
|
||||
@ -102,6 +102,67 @@ Foam::label Foam::checkTopology
|
||||
}
|
||||
}
|
||||
|
||||
if (allTopology)
|
||||
{
|
||||
labelList nInternalFaces(mesh.nCells(), 0);
|
||||
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
{
|
||||
nInternalFaces[mesh.faceOwner()[faceI]]++;
|
||||
nInternalFaces[mesh.faceNeighbour()[faceI]]++;
|
||||
}
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
forAll(patches, patchI)
|
||||
{
|
||||
if (patches[patchI].coupled())
|
||||
{
|
||||
const unallocLabelList& owners = patches[patchI].faceCells();
|
||||
|
||||
forAll(owners, i)
|
||||
{
|
||||
nInternalFaces[owners[i]]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
faceSet oneCells(mesh, "oneInternalFaceCells", mesh.nCells()/100);
|
||||
faceSet twoCells(mesh, "twoInternalFacesCells", mesh.nCells()/100);
|
||||
|
||||
forAll(nInternalFaces, cellI)
|
||||
{
|
||||
if (nInternalFaces[cellI] <= 1)
|
||||
{
|
||||
oneCells.insert(cellI);
|
||||
}
|
||||
else if (nInternalFaces[cellI] == 2)
|
||||
{
|
||||
twoCells.insert(cellI);
|
||||
}
|
||||
}
|
||||
|
||||
label nOneCells = returnReduce(oneCells.size(), sumOp<label>());
|
||||
|
||||
if (nOneCells > 0)
|
||||
{
|
||||
Info<< " <<Writing " << nOneCells
|
||||
<< " cells with with single non-boundary face to set "
|
||||
<< oneCells.name()
|
||||
<< endl;
|
||||
oneCells.write();
|
||||
}
|
||||
|
||||
label nTwoCells = returnReduce(twoCells.size(), sumOp<label>());
|
||||
|
||||
if (nTwoCells > 0)
|
||||
{
|
||||
Info<< " <<Writing " << nTwoCells
|
||||
<< " cells with with single non-boundary face to set "
|
||||
<< twoCells.name()
|
||||
<< endl;
|
||||
twoCells.write();
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
regionSplit rs(mesh);
|
||||
|
||||
|
||||
@ -60,10 +60,11 @@ SourceFiles
|
||||
|
||||
#include "className.H"
|
||||
#include "fileName.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "stringList.H"
|
||||
#include "wordList.H"
|
||||
#include "primitivePatch.H"
|
||||
#include "PrimitivePatchInterpolation.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
|
||||
|
||||
@ -491,7 +492,6 @@ class vtkPV3Foam
|
||||
void convertVolFields
|
||||
(
|
||||
const fvMesh&,
|
||||
const volPointInterpolation&,
|
||||
const PtrList<PrimitivePatchInterpolation<primitivePatch> >&,
|
||||
const IOobjectList&,
|
||||
vtkMultiBlockDataSet* output
|
||||
@ -502,7 +502,7 @@ class vtkPV3Foam
|
||||
void convertVolFieldBlock
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>&,
|
||||
const GeometricField<Type, pointPatchField, pointMesh>&,
|
||||
autoPtr<GeometricField<Type, pointPatchField, pointMesh> >&,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const partInfo& selector,
|
||||
const List<polyDecomp>& decompLst
|
||||
|
||||
@ -106,8 +106,6 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
printMemory();
|
||||
}
|
||||
|
||||
// Construct interpolation on the raw mesh
|
||||
volPointInterpolation pInterp(mesh);
|
||||
|
||||
PtrList<PrimitivePatchInterpolation<primitivePatch> >
|
||||
ppInterpList(mesh.boundaryMesh().size());
|
||||
@ -127,23 +125,23 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
|
||||
convertVolFields<scalar>
|
||||
(
|
||||
mesh, pInterp, ppInterpList, objects, output
|
||||
mesh, ppInterpList, objects, output
|
||||
);
|
||||
convertVolFields<vector>
|
||||
(
|
||||
mesh, pInterp, ppInterpList, objects, output
|
||||
mesh, ppInterpList, objects, output
|
||||
);
|
||||
convertVolFields<sphericalTensor>
|
||||
(
|
||||
mesh, pInterp, ppInterpList, objects, output
|
||||
mesh, ppInterpList, objects, output
|
||||
);
|
||||
convertVolFields<symmTensor>
|
||||
(
|
||||
mesh, pInterp, ppInterpList, objects, output
|
||||
mesh, ppInterpList, objects, output
|
||||
);
|
||||
convertVolFields<tensor>
|
||||
(
|
||||
mesh, pInterp, ppInterpList, objects, output
|
||||
mesh, ppInterpList, objects, output
|
||||
);
|
||||
|
||||
if (debug)
|
||||
|
||||
@ -34,6 +34,8 @@ InClass
|
||||
#include "emptyFvPatchField.H"
|
||||
#include "wallPolyPatch.H"
|
||||
#include "faceSet.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
#include "vtkPV3FoamFaceField.H"
|
||||
#include "vtkPV3FoamPatchField.H"
|
||||
|
||||
@ -43,7 +45,6 @@ template<class Type>
|
||||
void Foam::vtkPV3Foam::convertVolFields
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const volPointInterpolation& pInterp,
|
||||
const PtrList<PrimitivePatchInterpolation<primitivePatch> >& ppInterpList,
|
||||
const IOobjectList& objects,
|
||||
vtkMultiBlockDataSet* output
|
||||
@ -63,23 +64,22 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
continue;
|
||||
}
|
||||
|
||||
// Load field
|
||||
GeometricField<Type, fvPatchField, volMesh> tf
|
||||
(
|
||||
*iter(),
|
||||
mesh
|
||||
);
|
||||
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh> > tptf
|
||||
(
|
||||
pInterp.interpolate(tf)
|
||||
);
|
||||
// Interpolated field (demand driven)
|
||||
autoPtr<GeometricField<Type, pointPatchField, pointMesh> > ptfPtr;
|
||||
|
||||
|
||||
// Convert activated internalMesh regions
|
||||
convertVolFieldBlock
|
||||
(
|
||||
tf,
|
||||
tptf(),
|
||||
ptfPtr,
|
||||
output,
|
||||
partInfoVolume_,
|
||||
regionPolyDecomp_
|
||||
@ -89,7 +89,7 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
convertVolFieldBlock
|
||||
(
|
||||
tf,
|
||||
tptf(),
|
||||
ptfPtr,
|
||||
output,
|
||||
partInfoCellZones_,
|
||||
zonePolyDecomp_
|
||||
@ -99,7 +99,7 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
convertVolFieldBlock
|
||||
(
|
||||
tf,
|
||||
tptf(),
|
||||
ptfPtr,
|
||||
output,
|
||||
partInfoCellSets_,
|
||||
csetPolyDecomp_
|
||||
@ -258,46 +258,60 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::vtkPV3Foam::convertVolFieldBlock
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& tf,
|
||||
const GeometricField<Type, pointPatchField, pointMesh>& ptf,
|
||||
autoPtr<GeometricField<Type, pointPatchField, pointMesh> >& ptfPtr,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const partInfo& selector,
|
||||
const List<polyDecomp>& decompLst
|
||||
)
|
||||
{
|
||||
for (int partId = selector.start(); partId < selector.end(); ++partId)
|
||||
{
|
||||
const label datasetNo = partDataset_[partId];
|
||||
for (int partId = selector.start(); partId < selector.end(); ++partId)
|
||||
{
|
||||
const label datasetNo = partDataset_[partId];
|
||||
|
||||
if (datasetNo >= 0 && partStatus_[partId])
|
||||
{
|
||||
convertVolField
|
||||
(
|
||||
tf,
|
||||
output,
|
||||
selector,
|
||||
datasetNo,
|
||||
decompLst[datasetNo]
|
||||
);
|
||||
if (datasetNo >= 0 && partStatus_[partId])
|
||||
{
|
||||
convertVolField
|
||||
(
|
||||
tf,
|
||||
output,
|
||||
selector,
|
||||
datasetNo,
|
||||
decompLst[datasetNo]
|
||||
);
|
||||
|
||||
convertPointField
|
||||
(
|
||||
ptf,
|
||||
tf,
|
||||
output,
|
||||
selector,
|
||||
datasetNo,
|
||||
decompLst[datasetNo]
|
||||
);
|
||||
}
|
||||
}
|
||||
if (!ptfPtr.valid())
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "convertVolFieldBlock interpolating:" << tf.name()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
ptfPtr.reset
|
||||
(
|
||||
volPointInterpolation::New(tf.mesh()).interpolate(tf).ptr()
|
||||
);
|
||||
}
|
||||
|
||||
convertPointField
|
||||
(
|
||||
ptfPtr(),
|
||||
tf,
|
||||
output,
|
||||
selector,
|
||||
datasetNo,
|
||||
decompLst[datasetNo]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::vtkPV3Foam::convertVolField
|
||||
(
|
||||
|
||||
@ -115,7 +115,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
Info<< "writing " << exportName;
|
||||
if (scaleFactor > 0)
|
||||
if (scaleFactor <= 0)
|
||||
{
|
||||
Info<< " without scaling" << endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user