ENH: moved maxCo out of loop

This commit is contained in:
andy
2011-03-01 16:16:56 +00:00
parent 2b241996df
commit cefb78fc6d

View File

@ -295,6 +295,7 @@ bool Foam::KinematicParcel<ParcelType>::move
const polyMesh& mesh = td.cloud().pMesh(); const polyMesh& mesh = td.cloud().pMesh();
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh(); const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
const scalarField& V = mesh.cellVolumes(); const scalarField& V = mesh.cellVolumes();
const scalar maxCo = td.cloud().solution().maxCo();
scalar tEnd = (1.0 - p.stepFraction())*trackTime; scalar tEnd = (1.0 - p.stepFraction())*trackTime;
const scalar dtMax = tEnd; const scalar dtMax = tEnd;
@ -315,7 +316,6 @@ bool Foam::KinematicParcel<ParcelType>::move
if (p.active() && magU > ROOTVSMALL) if (p.active() && magU > ROOTVSMALL)
{ {
const scalar d = dt*magU; const scalar d = dt*magU;
const scalar maxCo = td.cloud().solution().maxCo();
const scalar dCorr = min(d, maxCo*cbrt(V[cellI])); const scalar dCorr = min(d, maxCo*cbrt(V[cellI]));
dt *= dt *=
dCorr/d dCorr/d