mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: cyclicAMI: differentiate between coupled geometry and coupled fields
This commit is contained in:
@ -96,18 +96,6 @@ public:
|
|||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~coupledFacePointPatch();
|
virtual ~coupledFacePointPatch();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Return true because this patch is coupled
|
|
||||||
virtual bool coupled() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -285,7 +285,8 @@ public:
|
|||||||
//- Return boundaryMesh reference
|
//- Return boundaryMesh reference
|
||||||
const polyBoundaryMesh& boundaryMesh() const;
|
const polyBoundaryMesh& boundaryMesh() const;
|
||||||
|
|
||||||
//- Return true if this patch field is coupled
|
//- Return true if this patch is geometrically coupled (i.e. faces and
|
||||||
|
// points correspondence)
|
||||||
virtual bool coupled() const
|
virtual bool coupled() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -106,7 +106,7 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
|
|||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cyclicAMIPatch_.coupled())
|
if (this->coupled())
|
||||||
{
|
{
|
||||||
this->evaluate(Pstream::blocking);
|
this->evaluate(Pstream::blocking);
|
||||||
}
|
}
|
||||||
@ -140,6 +140,27 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
bool Foam::cyclicAMIFvPatchField<Type>::coupled() const
|
||||||
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
Pstream::parRun()
|
||||||
|
|| (
|
||||||
|
this->cyclicAMIPatch_.size()
|
||||||
|
&& this->cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().size()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::Field<Type> >
|
Foam::tmp<Foam::Field<Type> >
|
||||||
Foam::cyclicAMIFvPatchField<Type>::patchNeighbourField() const
|
Foam::cyclicAMIFvPatchField<Type>::patchNeighbourField() const
|
||||||
|
|||||||
@ -147,8 +147,12 @@ public:
|
|||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
|
||||||
|
//- Return true if coupled. Note that the underlying patch
|
||||||
|
// is not coupled() - the points don't align.
|
||||||
|
virtual bool coupled() const;
|
||||||
|
|
||||||
//- Return neighbour coupled internal cell data
|
//- Return neighbour coupled internal cell data
|
||||||
tmp<Field<Type> > patchNeighbourField() const;
|
virtual tmp<Field<Type> > patchNeighbourField() const;
|
||||||
|
|
||||||
//- Return reference to neighbour patchField
|
//- Return reference to neighbour patchField
|
||||||
const cyclicAMIFvPatchField<Type>& neighbourPatchField() const;
|
const cyclicAMIFvPatchField<Type>& neighbourPatchField() const;
|
||||||
|
|||||||
@ -154,7 +154,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return neighbour field given internal field
|
//- Return neighbour field given internal field
|
||||||
tmp<Field<Type> > patchNeighbourField() const;
|
virtual tmp<Field<Type> > patchNeighbourField() const;
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
|||||||
@ -123,4 +123,27 @@ Foam::cyclicAMIFvsPatchField<Type>::cyclicAMIFvsPatchField
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
bool Foam::cyclicAMIFvsPatchField<Type>::coupled() const
|
||||||
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
Pstream::parRun()
|
||||||
|
|| (
|
||||||
|
this->cyclicAMIPatch_.size()
|
||||||
|
&& this->cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().size()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -123,6 +123,14 @@ public:
|
|||||||
new cyclicAMIFvsPatchField<Type>(*this, iF)
|
new cyclicAMIFvsPatchField<Type>(*this, iF)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return true if running parallel
|
||||||
|
virtual bool coupled() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -132,7 +132,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
|||||||
// Build the d-vectors
|
// Build the d-vectors
|
||||||
vectorField pd = p.delta();
|
vectorField pd = p.delta();
|
||||||
|
|
||||||
if (p.coupled())
|
if (pw.coupled())
|
||||||
{
|
{
|
||||||
forAll(pd, patchFacei)
|
forAll(pd, patchFacei)
|
||||||
{
|
{
|
||||||
@ -185,7 +185,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
|||||||
// Build the d-vectors
|
// Build the d-vectors
|
||||||
vectorField pd = p.delta();
|
vectorField pd = p.delta();
|
||||||
|
|
||||||
if (p.coupled())
|
if (pw.coupled())
|
||||||
{
|
{
|
||||||
forAll(pd, patchFacei)
|
forAll(pd, patchFacei)
|
||||||
{
|
{
|
||||||
@ -256,7 +256,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
|||||||
label patchFacei =
|
label patchFacei =
|
||||||
facei - mesh.boundaryMesh()[patchi].start();
|
facei - mesh.boundaryMesh()[patchi].start();
|
||||||
|
|
||||||
if (mesh.boundary()[patchi].coupled())
|
if (w.boundaryField()[patchi].coupled())
|
||||||
{
|
{
|
||||||
scalar wf = max
|
scalar wf = max
|
||||||
(
|
(
|
||||||
|
|||||||
@ -103,7 +103,7 @@ Foam::extendedCellToFaceStencil::extendedCellToFaceStencil(const polyMesh& mesh)
|
|||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
if (isA<coupledPolyPatch>(patches[patchI]))
|
if (patches[patchI].coupled())
|
||||||
{
|
{
|
||||||
const coupledPolyPatch& cpp =
|
const coupledPolyPatch& cpp =
|
||||||
refCast<const coupledPolyPatch>(patches[patchI]);
|
refCast<const coupledPolyPatch>(patches[patchI]);
|
||||||
|
|||||||
@ -38,7 +38,7 @@ Foam::extendedFaceToCellStencil::extendedFaceToCellStencil(const polyMesh& mesh)
|
|||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
if (isA<coupledPolyPatch>(patches[patchI]))
|
if (patches[patchI].coupled())
|
||||||
{
|
{
|
||||||
const coupledPolyPatch& cpp =
|
const coupledPolyPatch& cpp =
|
||||||
refCast<const coupledPolyPatch>(patches[patchI]);
|
refCast<const coupledPolyPatch>(patches[patchI]);
|
||||||
|
|||||||
@ -157,7 +157,7 @@ public:
|
|||||||
|
|
||||||
forAll(mesh.boundary(), patchi)
|
forAll(mesh.boundary(), patchi)
|
||||||
{
|
{
|
||||||
if (mesh.boundary()[patchi].coupled())
|
if (clippedLinearWeights.boundaryField()[patchi].coupled())
|
||||||
{
|
{
|
||||||
clippedLinearWeights.boundaryField()[patchi] =
|
clippedLinearWeights.boundaryField()[patchi] =
|
||||||
max
|
max
|
||||||
|
|||||||
@ -129,7 +129,7 @@ public:
|
|||||||
|
|
||||||
forAll(mesh.boundary(), patchI)
|
forAll(mesh.boundary(), patchI)
|
||||||
{
|
{
|
||||||
if (mesh.boundary()[patchI].coupled())
|
if (reverseLinearWeights.boundaryField()[patchI].coupled())
|
||||||
{
|
{
|
||||||
reverseLinearWeights.boundaryField()[patchI] =
|
reverseLinearWeights.boundaryField()[patchI] =
|
||||||
1.0 - cdWeights.boundaryField()[patchI];
|
1.0 - cdWeights.boundaryField()[patchI];
|
||||||
|
|||||||
@ -316,7 +316,7 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
|
|||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!pp.coupled()
|
!magSf.boundaryField()[patchI].coupled()
|
||||||
|| refCast<const coupledPolyPatch>(pp).owner()
|
|| refCast<const coupledPolyPatch>(pp).owner()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -107,6 +107,17 @@ public:
|
|||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~cyclicAMIPointPatch();
|
virtual ~cyclicAMIPointPatch();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Is patch 'coupled'. Note that on AMI the geometry is not
|
||||||
|
// coupled but the fields are!
|
||||||
|
virtual bool coupled() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -548,23 +548,6 @@ Foam::cyclicAMIPolyPatch::~cyclicAMIPolyPatch()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::cyclicAMIPolyPatch::coupled() const
|
|
||||||
{
|
|
||||||
if
|
|
||||||
(
|
|
||||||
Pstream::parRun()
|
|
||||||
|| (size() && neighbPatch().size())
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::cyclicAMIPolyPatch::neighbPatchID() const
|
Foam::label Foam::cyclicAMIPolyPatch::neighbPatchID() const
|
||||||
{
|
{
|
||||||
if (nbrPatchID_ == -1)
|
if (nbrPatchID_ == -1)
|
||||||
|
|||||||
@ -254,10 +254,12 @@ public:
|
|||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return true only if is coupled. Note that for non-parallel
|
//- Is patch 'coupled'. Note that on AMI the geometry is not
|
||||||
// operation of a decomposed case this can return the wrong
|
// coupled but the fields are!
|
||||||
// result
|
virtual bool coupled() const
|
||||||
virtual bool coupled() const;
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//- Neighbour patch name
|
//- Neighbour patch name
|
||||||
inline const word& neighbPatchName() const;
|
inline const word& neighbPatchName() const;
|
||||||
|
|||||||
@ -1769,7 +1769,7 @@ Foam::isoSurface::isoSurface
|
|||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
// Adapt separated coupled (proc and cyclic) patches
|
// Adapt separated coupled (proc and cyclic) patches
|
||||||
if (isA<coupledPolyPatch>(pp))
|
if (pp.coupled())
|
||||||
{
|
{
|
||||||
fvPatchVectorField& pfld = const_cast<fvPatchVectorField&>
|
fvPatchVectorField& pfld = const_cast<fvPatchVectorField&>
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user