Skip to content
Snippets Groups Projects
Commit 7e810605 authored by andy's avatar andy
Browse files

ENH: Updated kinematic cloud theta field calculation

parent be3d8be6
No related merge requests found
...@@ -370,42 +370,22 @@ Foam::KinematicCloud<CloudType>::theta() const ...@@ -370,42 +370,22 @@ Foam::KinematicCloud<CloudType>::theta() const
false false
), ),
mesh_, mesh_,
dimensionedScalar("zero", dimless, 0.0) dimensionedScalar("zero", dimless, 0.0),
zeroGradientFvPatchScalarField::typeName
) )
); );
volScalarField& theta = ttheta(); volScalarField& theta = ttheta();
theta.boundaryField() == 0;
forAllConstIter(typename KinematicCloud<CloudType>, *this, iter) forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
{ {
const parcelType& p = iter(); const parcelType& p = iter();
const label cellI = p.cell(); const label cellI = p.cell();
if ((p.face() != -1))
{
const label patchI = p.patch(p.face());
if (patchI != -1)
{
scalarField& thetap = theta.boundaryField()[patchI];
const label faceI = p.patchFace(patchI, p.face());
thetap[faceI] += p.nParticle()*p.areaP();
}
}
theta[cellI] += p.nParticle()*p.volume(); theta[cellI] += p.nParticle()*p.volume();
} }
theta.internalField() /= mesh_.V(); theta.internalField() /= mesh_.V();
theta.correctBoundaryConditions();
forAll(theta.boundaryField(), patchI)
{
scalarField& thetap = theta.boundaryField()[patchI];
if (thetap.size() > 0)
{
thetap /= mesh_.magSf().boundaryField()[patchI];
}
}
return ttheta; return ttheta;
} }
......
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