Skip to content
Snippets Groups Projects
Commit 6a9cfbe5 authored by Henry's avatar Henry
Browse files

fvMesh: added delta() function which returns the face-delta surface field

parent cc2eb6a8
No related merge requests found
...@@ -312,6 +312,9 @@ public: ...@@ -312,6 +312,9 @@ public:
//- Return face centres as surfaceVectorField //- Return face centres as surfaceVectorField
const surfaceVectorField& Cf() const; const surfaceVectorField& Cf() const;
//- Return face deltas as surfaceVectorField
tmp<surfaceVectorField> delta() const;
// Edit // Edit
......
...@@ -372,6 +372,53 @@ const surfaceVectorField& fvMesh::Cf() const ...@@ -372,6 +372,53 @@ const surfaceVectorField& fvMesh::Cf() const
} }
tmp<surfaceVectorField> fvMesh::delta() const
{
if (debug)
{
Info<< "void fvMesh::delta() : "
<< "calculating face deltas"
<< endl;
}
tmp<surfaceVectorField> tdelta
(
new surfaceVectorField
(
IOobject
(
"delta",
pointsInstance(),
meshSubDir,
*this,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
*this,
dimLength
)
);
surfaceVectorField& delta = tdelta();
const volVectorField& C = this->C();
const labelUList& owner = this->owner();
const labelUList& neighbour = this->neighbour();
forAll(owner, facei)
{
delta[facei] = C[neighbour[facei]] - C[owner[facei]];
}
forAll(delta.boundaryField(), patchi)
{
delta.boundaryField()[patchi] = boundary()[patchi].delta();
}
return tdelta;
}
const surfaceScalarField& fvMesh::phi() const const surfaceScalarField& fvMesh::phi() const
{ {
if (!phiPtr_) if (!phiPtr_)
......
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