Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
commit
ddeaf2c4c8
@ -909,6 +909,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (own[faceI] != -1 && nei[faceI] != -1)
|
if (own[faceI] != -1 && nei[faceI] != -1)
|
||||||
{
|
{
|
||||||
|
faceToCell[1].insert(faceI, own[faceI]);
|
||||||
|
faceToCell[0].insert(faceI, nei[faceI]);
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -60,7 +60,7 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceOrthogonality
|
|||||||
// Coupled faces
|
// Coupled faces
|
||||||
|
|
||||||
pointField neighbourCc;
|
pointField neighbourCc;
|
||||||
syncTools::swapBoundaryCellList(mesh, cc, neighbourCc);
|
syncTools::swapBoundaryCellPositions(mesh, cc, neighbourCc);
|
||||||
|
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchI)
|
||||||
{
|
{
|
||||||
@ -123,7 +123,7 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceSkewness
|
|||||||
// (i.e. treat as if mirror cell on other side)
|
// (i.e. treat as if mirror cell on other side)
|
||||||
|
|
||||||
pointField neighbourCc;
|
pointField neighbourCc;
|
||||||
syncTools::swapBoundaryCellList(mesh, cellCtrs, neighbourCc);
|
syncTools::swapBoundaryCellPositions(mesh, cellCtrs, neighbourCc);
|
||||||
|
|
||||||
forAll(pbm, patchI)
|
forAll(pbm, patchI)
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,44 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::syncTools::swapBoundaryCellPositions
|
||||||
|
(
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const UList<point>& cellData,
|
||||||
|
List<point>& neighbourCellData
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (cellData.size() != mesh.nCells())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"syncTools<class T>::swapBoundaryCellPositions"
|
||||||
|
"(const polyMesh&, const UList<T>&, List<T>&)"
|
||||||
|
) << "Number of cell values " << cellData.size()
|
||||||
|
<< " is not equal to the number of cells in the mesh "
|
||||||
|
<< mesh.nCells() << abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
|
label nBnd = mesh.nFaces()-mesh.nInternalFaces();
|
||||||
|
|
||||||
|
neighbourCellData.setSize(nBnd);
|
||||||
|
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[patchI];
|
||||||
|
const labelUList& faceCells = pp.faceCells();
|
||||||
|
forAll(faceCells, i)
|
||||||
|
{
|
||||||
|
label bFaceI = pp.start()+i-mesh.nInternalFaces();
|
||||||
|
neighbourCellData[bFaceI] = cellData[faceCells[i]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
syncTools::swapBoundaryFacePositions(mesh, neighbourCellData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
|
Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
|
||||||
{
|
{
|
||||||
PackedBoolList isMasterPoint(mesh.nPoints());
|
PackedBoolList isMasterPoint(mesh.nPoints());
|
||||||
|
@ -442,18 +442,17 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Swap coupled positions.
|
//- Swap coupled positions.
|
||||||
template<class T>
|
|
||||||
static void swapBoundaryFacePositions
|
static void swapBoundaryFacePositions
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
UList<T>& l
|
UList<point>& l
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
syncBoundaryFaceList
|
syncBoundaryFaceList
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
l,
|
l,
|
||||||
eqOp<T>(),
|
eqOp<point>(),
|
||||||
mapDistribute::transformPosition()
|
mapDistribute::transformPosition()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -490,6 +489,14 @@ public:
|
|||||||
List<T>& neighbourCellData
|
List<T>& neighbourCellData
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Swap to obtain neighbour cell positions for all boundary faces
|
||||||
|
static void swapBoundaryCellPositions
|
||||||
|
(
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const UList<point>& cellData,
|
||||||
|
List<point>& neighbourCellData
|
||||||
|
);
|
||||||
|
|
||||||
// Sparse versions
|
// Sparse versions
|
||||||
|
|
||||||
//- Synchronize values on selected points.
|
//- Synchronize values on selected points.
|
||||||
@ -531,11 +538,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Synchronize locations on selected edges.
|
//- Synchronize locations on selected edges.
|
||||||
template<class T, class CombineOp>
|
template<class CombineOp>
|
||||||
static void syncEdgePositions
|
static void syncEdgePositions
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
EdgeMap<T>& l,
|
EdgeMap<point>& l,
|
||||||
const CombineOp& cop
|
const CombineOp& cop
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -104,16 +104,6 @@ Foam::coupledFvPatchField<Type>::coupledFvPatchField
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::tmp<Foam::Field<Type> > Foam::coupledFvPatchField<Type>::snGrad() const
|
|
||||||
{
|
|
||||||
notImplemented("coupledFvPatchField<Type>::snGrad()");
|
|
||||||
return
|
|
||||||
this->patch().deltaCoeffs()
|
|
||||||
*(this->patchNeighbourField() - this->patchInternalField());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::Field<Type> > Foam::coupledFvPatchField<Type>::snGrad
|
Foam::tmp<Foam::Field<Type> > Foam::coupledFvPatchField<Type>::snGrad
|
||||||
(
|
(
|
||||||
|
@ -145,7 +145,14 @@ public:
|
|||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Return patch-normal gradient
|
//- Return patch-normal gradient
|
||||||
virtual tmp<Field<Type> > snGrad() const;
|
virtual tmp<Field<Type> > snGrad() const
|
||||||
|
{
|
||||||
|
notImplemented
|
||||||
|
(
|
||||||
|
type() + "::coupledFvPatchField<Type>::snGrad()"
|
||||||
|
);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
//- Initialise the evaluation of the patch field
|
//- Initialise the evaluation of the patch field
|
||||||
virtual void initEvaluate
|
virtual void initEvaluate
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -28,15 +28,10 @@ License
|
|||||||
#include "demandDrivenData.H"
|
#include "demandDrivenData.H"
|
||||||
#include "transformField.H"
|
#include "transformField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
Foam::processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
(
|
(
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<Type, volMesh>& iF
|
const DimensionedField<Type, volMesh>& iF
|
||||||
@ -48,7 +43,7 @@ processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
Foam::processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
(
|
(
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<Type, volMesh>& iF,
|
const DimensionedField<Type, volMesh>& iF,
|
||||||
@ -63,7 +58,7 @@ processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
|||||||
|
|
||||||
// Construct by mapping given processorCyclicFvPatchField<Type>
|
// Construct by mapping given processorCyclicFvPatchField<Type>
|
||||||
template<class Type>
|
template<class Type>
|
||||||
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
Foam::processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
(
|
(
|
||||||
const processorCyclicFvPatchField<Type>& ptf,
|
const processorCyclicFvPatchField<Type>& ptf,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
@ -97,7 +92,7 @@ processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
Foam::processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
(
|
(
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<Type, volMesh>& iF,
|
const DimensionedField<Type, volMesh>& iF,
|
||||||
@ -144,7 +139,7 @@ processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
Foam::processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
(
|
(
|
||||||
const processorCyclicFvPatchField<Type>& ptf
|
const processorCyclicFvPatchField<Type>& ptf
|
||||||
)
|
)
|
||||||
@ -157,7 +152,7 @@ processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
Foam::processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
(
|
(
|
||||||
const processorCyclicFvPatchField<Type>& ptf,
|
const processorCyclicFvPatchField<Type>& ptf,
|
||||||
const DimensionedField<Type, volMesh>& iF
|
const DimensionedField<Type, volMesh>& iF
|
||||||
@ -172,107 +167,8 @@ processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
|||||||
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
processorCyclicFvPatchField<Type>::~processorCyclicFvPatchField()
|
Foam::processorCyclicFvPatchField<Type>::~processorCyclicFvPatchField()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
//template<class Type>
|
|
||||||
//tmp<Field<Type> >
|
|
||||||
//processorCyclicFvPatchField<Type>::patchNeighbourField() const
|
|
||||||
//{
|
|
||||||
// return *this;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//template<class Type>
|
|
||||||
//void processorCyclicFvPatchField<Type>::initEvaluate
|
|
||||||
//(
|
|
||||||
// const Pstream::commsTypes commsType
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// if (Pstream::parRun())
|
|
||||||
// {
|
|
||||||
// procPatch_.compressedSend(commsType, this->patchInternalField()());
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//template<class Type>
|
|
||||||
//void processorCyclicFvPatchField<Type>::evaluate
|
|
||||||
//(
|
|
||||||
// const Pstream::commsTypes commsType
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// if (Pstream::parRun())
|
|
||||||
// {
|
|
||||||
// procPatch_.compressedReceive<Type>(commsType, *this);
|
|
||||||
//
|
|
||||||
// if (doTransform())
|
|
||||||
// {
|
|
||||||
// transform(*this, procPatch_.forwardT(), *this);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//template<class Type>
|
|
||||||
//tmp<Field<Type> > processorCyclicFvPatchField<Type>::snGrad() const
|
|
||||||
//{
|
|
||||||
// return this->patch().deltaCoeffs()*(*this - this->patchInternalField());
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//template<class Type>
|
|
||||||
//void processorCyclicFvPatchField<Type>::initInterfaceMatrixUpdate
|
|
||||||
//(
|
|
||||||
// scalarField&,
|
|
||||||
// const scalarField& psiInternal,
|
|
||||||
// const scalarField&,
|
|
||||||
// const direction,
|
|
||||||
// const Pstream::commsTypes commsType
|
|
||||||
//) const
|
|
||||||
//{
|
|
||||||
// procPatch_.compressedSend
|
|
||||||
// (
|
|
||||||
// commsType,
|
|
||||||
// this->patch().patchInternalField(psiInternal)()
|
|
||||||
// );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//template<class Type>
|
|
||||||
//void processorCyclicFvPatchField<Type>::updateInterfaceMatrix
|
|
||||||
//(
|
|
||||||
// scalarField& result,
|
|
||||||
// const scalarField&,
|
|
||||||
// const scalarField& coeffs,
|
|
||||||
// const direction cmpt,
|
|
||||||
// const Pstream::commsTypes commsType
|
|
||||||
//) const
|
|
||||||
//{
|
|
||||||
// scalarField pnf
|
|
||||||
// (
|
|
||||||
// procPatch_.compressedReceive<scalar>(commsType, this->size())()
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// // Transform according to the transformation tensor
|
|
||||||
// transformCoupleField(pnf, cmpt);
|
|
||||||
//
|
|
||||||
// // Multiply the field by coefficients and add into the result
|
|
||||||
//
|
|
||||||
// const labelUList& faceCells = this->patch().faceCells();
|
|
||||||
//
|
|
||||||
// forAll(faceCells, elemI)
|
|
||||||
// {
|
|
||||||
// result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
@ -173,20 +173,10 @@ void Foam::fvPatchField<Type>::check(const fvPatchField<Type>& ptf) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::tmp<Foam::Field<Type> > Foam::fvPatchField<Type>::snGrad
|
|
||||||
(
|
|
||||||
const scalarField& deltaCoeffs
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return deltaCoeffs*(*this - patchInternalField());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::Field<Type> > Foam::fvPatchField<Type>::snGrad() const
|
Foam::tmp<Foam::Field<Type> > Foam::fvPatchField<Type>::snGrad() const
|
||||||
{
|
{
|
||||||
return this->snGrad(patch_.deltaCoeffs());
|
return patch_.deltaCoeffs()*(*this - patchInternalField());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -347,13 +347,21 @@ public:
|
|||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
|
||||||
//- Return patch-normal gradient
|
//- Return patch-normal gradient
|
||||||
|
virtual tmp<Field<Type> > snGrad() const;
|
||||||
|
|
||||||
|
//- Return patch-normal gradient for coupled-patches
|
||||||
|
// using the deltaCoeffs provided
|
||||||
virtual tmp<Field<Type> > snGrad
|
virtual tmp<Field<Type> > snGrad
|
||||||
(
|
(
|
||||||
const scalarField& deltaCoeffs
|
const scalarField& deltaCoeffs
|
||||||
) const;
|
) const
|
||||||
|
{
|
||||||
//- Return patch-normal gradient
|
notImplemented
|
||||||
virtual tmp<Field<Type> > snGrad() const;
|
(
|
||||||
|
type() + "::snGrad(const scalarField& deltaCoeffs)"
|
||||||
|
);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
//- Update the coefficients associated with the patch field
|
||||||
// Sets Updated to true
|
// Sets Updated to true
|
||||||
@ -421,6 +429,15 @@ public:
|
|||||||
|
|
||||||
//- Return the matrix diagonal coefficients corresponding to the
|
//- Return the matrix diagonal coefficients corresponding to the
|
||||||
// evaluation of the gradient of this patchField
|
// evaluation of the gradient of this patchField
|
||||||
|
virtual tmp<Field<Type> > gradientInternalCoeffs() const
|
||||||
|
{
|
||||||
|
notImplemented(type() + "::gradientInternalCoeffs()");
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the matrix diagonal coefficients corresponding to the
|
||||||
|
// evaluation of the gradient of this coupled patchField
|
||||||
|
// using the deltaCoeffs provided
|
||||||
virtual tmp<Field<Type> > gradientInternalCoeffs
|
virtual tmp<Field<Type> > gradientInternalCoeffs
|
||||||
(
|
(
|
||||||
const scalarField& deltaCoeffs
|
const scalarField& deltaCoeffs
|
||||||
@ -434,16 +451,17 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return the matrix diagonal coefficients corresponding to the
|
//- Return the matrix source coefficients corresponding to the
|
||||||
// evaluation of the gradient of this patchField
|
// evaluation of the gradient of this patchField
|
||||||
virtual tmp<Field<Type> > gradientInternalCoeffs() const
|
virtual tmp<Field<Type> > gradientBoundaryCoeffs() const
|
||||||
{
|
{
|
||||||
notImplemented(type() + "::gradientInternalCoeffs()");
|
notImplemented(type() + "::gradientBoundaryCoeffs()");
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return the matrix source coefficients corresponding to the
|
//- Return the matrix source coefficients corresponding to the
|
||||||
// evaluation of the gradient of this patchField
|
// evaluation of the gradient of this coupled patchField
|
||||||
|
// using the deltaCoeffs provided
|
||||||
virtual tmp<Field<Type> > gradientBoundaryCoeffs
|
virtual tmp<Field<Type> > gradientBoundaryCoeffs
|
||||||
(
|
(
|
||||||
const scalarField& deltaCoeffs
|
const scalarField& deltaCoeffs
|
||||||
@ -457,14 +475,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return the matrix source coefficients corresponding to the
|
|
||||||
// evaluation of the gradient of this patchField
|
|
||||||
virtual tmp<Field<Type> > gradientBoundaryCoeffs() const
|
|
||||||
{
|
|
||||||
notImplemented(type() + "::gradientBoundaryCoeffs()");
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//- Manipulate matrix
|
//- Manipulate matrix
|
||||||
virtual void manipulateMatrix(fvMatrix<Type>& matrix);
|
virtual void manipulateMatrix(fvMatrix<Type>& matrix);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -120,7 +120,7 @@ void Foam::searchableSurfaceToFaceZone::applyToSet
|
|||||||
|
|
||||||
// Boundary faces
|
// Boundary faces
|
||||||
vectorField nbrCellCentres;
|
vectorField nbrCellCentres;
|
||||||
syncTools::swapBoundaryCellList(mesh_, cc, nbrCellCentres);
|
syncTools::swapBoundaryCellPositions(mesh_, cc, nbrCellCentres);
|
||||||
|
|
||||||
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
||||||
|
|
||||||
|
@ -59,12 +59,13 @@ void Foam::energyRegionCoupledFvPatchScalarField::setMethod() const
|
|||||||
{
|
{
|
||||||
if (method_ == UNDEFINED)
|
if (method_ == UNDEFINED)
|
||||||
{
|
{
|
||||||
if (
|
if
|
||||||
this->db().foundObject<compressible::turbulenceModel>
|
(
|
||||||
(
|
this->db().foundObject<compressible::turbulenceModel>
|
||||||
"turbulenceModel"
|
(
|
||||||
)
|
"turbulenceModel"
|
||||||
)
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
method_ = FLUID;
|
method_ = FLUID;
|
||||||
}
|
}
|
||||||
@ -212,8 +213,7 @@ energyRegionCoupledFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
LduInterfaceField<scalar>(refCast<const lduInterface>(p)),
|
coupledFvPatchField<scalar>(p, iF),
|
||||||
fvPatchScalarField(p, iF),
|
|
||||||
regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
|
regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
|
||||||
method_(UNDEFINED),
|
method_(UNDEFINED),
|
||||||
nbrThermoPtr_(NULL),
|
nbrThermoPtr_(NULL),
|
||||||
@ -230,8 +230,7 @@ energyRegionCoupledFvPatchScalarField
|
|||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
LduInterfaceField<scalar>(refCast<const lduInterface>(p)),
|
coupledFvPatchField<scalar>(ptf, p, iF, mapper),
|
||||||
fvPatchScalarField(ptf, p, iF, mapper),
|
|
||||||
regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
|
regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
|
||||||
method_(ptf.method_),
|
method_(ptf.method_),
|
||||||
nbrThermoPtr_(NULL),
|
nbrThermoPtr_(NULL),
|
||||||
@ -247,8 +246,7 @@ energyRegionCoupledFvPatchScalarField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
LduInterfaceField<scalar>(refCast<const lduInterface>(p)),
|
coupledFvPatchField<scalar>(p, iF, dict),
|
||||||
fvPatchScalarField(p, iF, dict),
|
|
||||||
regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
|
regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
|
||||||
method_(UNDEFINED),
|
method_(UNDEFINED),
|
||||||
nbrThermoPtr_(NULL),
|
nbrThermoPtr_(NULL),
|
||||||
@ -287,8 +285,7 @@ energyRegionCoupledFvPatchScalarField
|
|||||||
const energyRegionCoupledFvPatchScalarField& ptf
|
const energyRegionCoupledFvPatchScalarField& ptf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
LduInterfaceField<scalar>(refCast<const lduInterface>(ptf.patch())),
|
coupledFvPatchField<scalar>(ptf),
|
||||||
fvPatchScalarField(ptf),
|
|
||||||
regionCoupledPatch_(ptf.regionCoupledPatch_),
|
regionCoupledPatch_(ptf.regionCoupledPatch_),
|
||||||
method_(ptf.method_),
|
method_(ptf.method_),
|
||||||
nbrThermoPtr_(NULL),
|
nbrThermoPtr_(NULL),
|
||||||
@ -303,8 +300,7 @@ energyRegionCoupledFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
LduInterfaceField<scalar>(refCast<const lduInterface>(ptf.patch())),
|
coupledFvPatchField<scalar>(ptf, iF),
|
||||||
fvPatchScalarField(ptf, iF),
|
|
||||||
regionCoupledPatch_(ptf.regionCoupledPatch_),
|
regionCoupledPatch_(ptf.regionCoupledPatch_),
|
||||||
method_(ptf.method_),
|
method_(ptf.method_),
|
||||||
nbrThermoPtr_(NULL),
|
nbrThermoPtr_(NULL),
|
||||||
@ -314,24 +310,19 @@ energyRegionCoupledFvPatchScalarField
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||||
snGrad() const
|
snGrad() const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
(*this - patchInternalField())*regionCoupledPatch_.patch().deltaCoeffs();
|
regionCoupledPatch_.patch().deltaCoeffs()
|
||||||
|
*(*this - patchInternalField());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::energyRegionCoupledFvPatchScalarField::initEvaluate
|
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||||
(
|
snGrad(const scalarField&) const
|
||||||
const Pstream::commsTypes
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (!updated())
|
return snGrad();
|
||||||
{
|
|
||||||
updateCoeffs();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -365,42 +356,6 @@ void Foam::energyRegionCoupledFvPatchScalarField::evaluate
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
|
||||||
valueInternalCoeffs
|
|
||||||
(
|
|
||||||
const tmp<scalarField>& w
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return scalar(pTraits<scalar>::one)*w;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
|
||||||
valueBoundaryCoeffs
|
|
||||||
(
|
|
||||||
const tmp<scalarField>& w
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return scalar(pTraits<scalar>::one)*(1.0 - w);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
|
||||||
gradientInternalCoeffs() const
|
|
||||||
{
|
|
||||||
return
|
|
||||||
-scalar(pTraits<scalar>::one)
|
|
||||||
*regionCoupledPatch_.patch().deltaCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
|
||||||
gradientBoundaryCoeffs() const
|
|
||||||
{
|
|
||||||
return -this->gradientInternalCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::Field<Foam::scalar> >
|
Foam::tmp<Foam::Field<Foam::scalar> >
|
||||||
Foam::energyRegionCoupledFvPatchScalarField::
|
Foam::energyRegionCoupledFvPatchScalarField::
|
||||||
patchNeighbourField() const
|
patchNeighbourField() const
|
||||||
@ -546,6 +501,7 @@ void Foam::energyRegionCoupledFvPatchScalarField::write(Ostream& os) const
|
|||||||
this->writeEntry("value", os);
|
this->writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -43,22 +43,23 @@ SourceFiles
|
|||||||
#include "fvPatchField.H"
|
#include "fvPatchField.H"
|
||||||
#include "NamedEnum.H"
|
#include "NamedEnum.H"
|
||||||
#include "basicThermo.H"
|
#include "basicThermo.H"
|
||||||
|
#include "coupledFvPatchField.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class energyRegionCoupledFvPatchScalarField Declaration
|
Class energyRegionCoupledFvPatchScalarField Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class energyRegionCoupledFvPatchScalarField
|
class energyRegionCoupledFvPatchScalarField
|
||||||
:
|
:
|
||||||
public LduInterfaceField<scalar>,
|
public coupledFvPatchField<scalar>
|
||||||
public fvPatchScalarField
|
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum kappaMethodType
|
enum kappaMethodType
|
||||||
@ -162,12 +163,6 @@ public:
|
|||||||
const DimensionedField<scalar, volMesh>&
|
const DimensionedField<scalar, volMesh>&
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~energyRegionCoupledFvPatchScalarField()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
//- Construct and return a clone setting internal field reference
|
||||||
virtual tmp<fvPatchField<scalar> > clone
|
virtual tmp<fvPatchField<scalar> > clone
|
||||||
(
|
(
|
||||||
@ -181,17 +176,15 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~energyRegionCoupledFvPatchScalarField()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return true if this patch field is coupled
|
|
||||||
virtual bool coupled() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Method to obtain K
|
//- Method to obtain K
|
||||||
word kappaMethod() const
|
word kappaMethod() const
|
||||||
{
|
{
|
||||||
@ -207,11 +200,13 @@ public:
|
|||||||
//- Return patch-normal gradient
|
//- Return patch-normal gradient
|
||||||
virtual tmp<scalarField> snGrad() const;
|
virtual tmp<scalarField> snGrad() const;
|
||||||
|
|
||||||
//- Initialise the evaluation of the patch field
|
//- Return patch-normal gradient
|
||||||
virtual void initEvaluate
|
// Note: the deltaCoeffs supplied are not used
|
||||||
|
virtual tmp<scalarField> snGrad
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes commsType
|
const scalarField& deltaCoeffs
|
||||||
);
|
) const;
|
||||||
|
|
||||||
|
|
||||||
//- Evaluate the patch field
|
//- Evaluate the patch field
|
||||||
virtual void evaluate
|
virtual void evaluate
|
||||||
@ -219,28 +214,6 @@ public:
|
|||||||
const Pstream::commsTypes commsType
|
const Pstream::commsTypes commsType
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Return the matrix diagonal coefficients corresponding to the
|
|
||||||
// evaluation of the value of this patchField with given weights
|
|
||||||
virtual tmp<scalarField> valueInternalCoeffs
|
|
||||||
(
|
|
||||||
const tmp<scalarField>&
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the matrix source coefficients corresponding to the
|
|
||||||
// evaluation of the value of this patchField with given weights
|
|
||||||
virtual tmp<scalarField> valueBoundaryCoeffs
|
|
||||||
(
|
|
||||||
const tmp<scalarField>&
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the matrix diagonal coefficients corresponding to the
|
|
||||||
// evaluation of the gradient of this patchField
|
|
||||||
virtual tmp<scalarField> gradientInternalCoeffs() const;
|
|
||||||
|
|
||||||
//- Return the matrix source coefficients corresponding to the
|
|
||||||
// evaluation of the gradient of this patchField
|
|
||||||
virtual tmp<scalarField> gradientBoundaryCoeffs() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Coupled interface functionality
|
// Coupled interface functionality
|
||||||
|
|
||||||
|
@ -49,5 +49,9 @@ adjustTimeStep no;
|
|||||||
|
|
||||||
maxCo 0.2;
|
maxCo 0.2;
|
||||||
|
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
#include "cuttingPlane"
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
cuttingPlane
|
||||||
|
{
|
||||||
|
type surfaces;
|
||||||
|
functionObjectLibs ("libsampling.so");
|
||||||
|
|
||||||
|
outputControl outputTime;
|
||||||
|
|
||||||
|
surfaceFormat vtk;
|
||||||
|
fields ( p U );
|
||||||
|
|
||||||
|
interpolationScheme cellPoint;
|
||||||
|
|
||||||
|
surfaces
|
||||||
|
(
|
||||||
|
zNormal
|
||||||
|
{
|
||||||
|
type cuttingPlane;
|
||||||
|
planeType pointAndNormal;
|
||||||
|
pointAndNormalDict
|
||||||
|
{
|
||||||
|
basePoint (0 0 0);
|
||||||
|
normalVector (0 0 1);
|
||||||
|
}
|
||||||
|
interpolate true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
@ -1,2 +1,2 @@
|
|||||||
c++DBUG =
|
c++DBUG =
|
||||||
c++OPT = -xSSE3 -O2 -no-prec-div
|
c++OPT = -xHost -O2 -no-prec-div
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
c++DBUG =
|
c++DBUG =
|
||||||
c++OPT = -xSSE3 -O2 -no-prec-div
|
c++OPT = -xHost -O2 -no-prec-div
|
||||||
|
Loading…
Reference in New Issue
Block a user