Merge branch 'master' of github.com:OpenFOAM/OpenFOAM-2.3.x
This commit is contained in:
commit
9586a4ebea
3 changed files with 35 additions and 12 deletions
|
|
@ -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-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -28,6 +28,12 @@ License
|
||||||
#include "IntegrationScheme.H"
|
#include "IntegrationScheme.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
Foam::label Foam::KinematicParcel<ParcelType>::maxTrackAttempts = 1;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
|
|
@ -271,7 +277,8 @@ bool Foam::KinematicParcel<ParcelType>::move
|
||||||
scalar tEnd = (1.0 - p.stepFraction())*trackTime;
|
scalar tEnd = (1.0 - p.stepFraction())*trackTime;
|
||||||
const scalar dtMax = tEnd;
|
const scalar dtMax = tEnd;
|
||||||
|
|
||||||
bool moving = true;
|
bool tracking = true;
|
||||||
|
label nTrackingStalled = 0;
|
||||||
|
|
||||||
while (td.keepParticle && !td.switchProcessor && tEnd > ROOTVSMALL)
|
while (td.keepParticle && !td.switchProcessor && tEnd > ROOTVSMALL)
|
||||||
{
|
{
|
||||||
|
|
@ -287,7 +294,7 @@ bool Foam::KinematicParcel<ParcelType>::move
|
||||||
const label cellI = p.cell();
|
const label cellI = p.cell();
|
||||||
|
|
||||||
const scalar magU = mag(U_);
|
const scalar magU = mag(U_);
|
||||||
if (p.active() && moving && (magU > ROOTVSMALL))
|
if (p.active() && tracking && (magU > ROOTVSMALL))
|
||||||
{
|
{
|
||||||
const scalar d = dt*magU;
|
const scalar d = dt*magU;
|
||||||
const scalar dCorr = min(d, maxCo*cellLengthScale[cellI]);
|
const scalar dCorr = min(d, maxCo*cellLengthScale[cellI]);
|
||||||
|
|
@ -300,13 +307,25 @@ bool Foam::KinematicParcel<ParcelType>::move
|
||||||
|
|
||||||
scalar newStepFraction = 1.0 - tEnd/trackTime;
|
scalar newStepFraction = 1.0 - tEnd/trackTime;
|
||||||
|
|
||||||
if
|
if (tracking)
|
||||||
(
|
|
||||||
mag(p.stepFraction() - newStepFraction)
|
|
||||||
< particle::minStepFractionTol
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
moving = false;
|
if
|
||||||
|
(
|
||||||
|
mag(p.stepFraction() - newStepFraction)
|
||||||
|
< particle::minStepFractionTol
|
||||||
|
)
|
||||||
|
{
|
||||||
|
nTrackingStalled++;
|
||||||
|
|
||||||
|
if (nTrackingStalled > maxTrackAttempts)
|
||||||
|
{
|
||||||
|
tracking = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nTrackingStalled = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p.stepFraction() = newStepFraction;
|
p.stepFraction() = newStepFraction;
|
||||||
|
|
|
||||||
|
|
@ -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-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -218,6 +218,10 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//- Number of particle tracking attempts before we assume that it stalls
|
||||||
|
static label maxTrackAttempts;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
|
||||||
|
|
@ -60,14 +60,14 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
||||||
typedef typename TrackData::cloudType::reactingCloudType reactingCloudType;
|
typedef typename TrackData::cloudType::reactingCloudType reactingCloudType;
|
||||||
PhaseChangeModel<reactingCloudType>& phaseChange = td.cloud().phaseChange();
|
PhaseChangeModel<reactingCloudType>& phaseChange = td.cloud().phaseChange();
|
||||||
|
|
||||||
if (!phaseChange.active())
|
if (!phaseChange.active() || (YPhase < SMALL))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar Tvap = phaseChange.Tvap(YComponents);
|
scalar Tvap = phaseChange.Tvap(YComponents);
|
||||||
|
|
||||||
if (T < Tvap || YPhase < SMALL)
|
if (T < Tvap)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue