本文整理汇总了C++中TrackData类的典型用法代码示例。如果您正苦于以下问题:C++ TrackData类的具体用法?C++ TrackData怎么用?C++ TrackData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TrackData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Foam::ThermoParcel<ParcelType>::setCellValues
(
TrackData& td,
const scalar dt,
const label cellI
)
{
ParcelType::setCellValues(td, dt, cellI);
tetIndices tetIs = this->currentTetIndices();
Cpc_ = td.CpInterp().interpolate(this->position(), tetIs);
Tc_ = td.TInterp().interpolate(this->position(), tetIs);
if (Tc_ < td.cloud().constProps().TMin())
{
if (debug)
{
WarningIn
(
"void Foam::ThermoParcel<ParcelType>::setCellValues"
"("
"TrackData&, "
"const scalar, "
"const label"
")"
) << "Limiting observed temperature in cell " << cellI << " to "
<< td.cloud().constProps().TMin() << nl << endl;
}
Tc_ = td.cloud().constProps().TMin();
}
}
示例2:
bool Foam::KinematicParcel<ParcelType>::hitPatch
(
const polyPatch& pp,
TrackData& td,
const label patchI,
const scalar trackFraction,
const tetIndices& tetIs
)
{
typename TrackData::cloudType::parcelType& p =
static_cast<typename TrackData::cloudType::parcelType&>(*this);
// Invoke post-processing model
td.cloud().functions().postPatch(p, patchI, pp.whichFace(p.face()));
// Invoke surface film model
if (td.cloud().surfaceFilm().transferParcel(p, pp, td.keepParticle))
{
// All interactions done
return true;
}
else
{
// Invoke patch interaction model
return td.cloud().patchInteraction().correct
(
p,
pp,
td.keepParticle,
trackFraction,
tetIs
);
}
}
示例3:
void Foam::ThermoParcel<ParcelType>::setCellValues
(
TrackData& td,
const scalar dt,
const label cellI
)
{
KinematicParcel<ParcelType>::setCellValues(td, dt, cellI);
cpc_ = td.cpInterp().interpolate(this->position(), cellI);
Tc_ = td.TInterp().interpolate(this->position(), cellI);
if (Tc_ < td.constProps().TMin())
{
WarningIn
(
"void Foam::ThermoParcel<ParcelType>::setCellValues"
"("
"TrackData&, "
"const scalar, "
"const label"
")"
) << "Limiting observed temperature in cell " << cellI << " to "
<< td.constProps().TMin() << nl << endl;
Tc_ = td.constProps().TMin();
}
}
示例4: i
void Tracks::list() {
QMapIterator<int, TrackData> i(tm);
while (i.hasNext()) {
i.next();
TrackData d = i.value();
qDebug("Tracks::list: item %d: ID: %d lang: '%s' name: '%s'",
i.key(), d.ID(), d.lang().toUtf8().constData(), d.name().toUtf8().constData() );
}
}
示例5: while
bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
{
ParcelType& p = static_cast<ParcelType&>(*this);
td.switchProcessor = false;
td.keepParticle = true;
const polyMesh& mesh = td.cloud().pMesh();
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
const scalar deltaT = mesh.time().deltaTValue();
scalar tEnd = (1.0 - p.stepFraction())*deltaT;
const scalar dtMax = tEnd;
while (td.keepParticle && !td.switchProcessor && tEnd > ROOTVSMALL)
{
// Apply correction to position for reduced-D cases
meshTools::constrainToMeshCentre(mesh, p.position());
// Set the Lagrangian time-step
scalar dt = min(dtMax, tEnd);
// Remember which cell the Parcel is in since this will change if a
// face is hit
label cellI = p.cell();
dt *= p.trackToFace(p.position() + dt*U_, td);
tEnd -= dt;
p.stepFraction() = 1.0 - tEnd/deltaT;
// Avoid problems with extremely small timesteps
if (dt > ROOTVSMALL)
{
// Update cell based properties
p.setCellValues(td, dt, cellI);
if (td.cloud().cellValueSourceCorrection())
{
p.cellValueSourceCorrection(td, dt, cellI);
}
p.calc(td, dt, cellI);
}
if (p.onBoundary() && td.keepParticle)
{
if (isA<processorPolyPatch>(pbMesh[p.patch(p.face())]))
{
td.switchProcessor = true;
}
}
}
return td.keepParticle;
}
示例6: max
Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
(
TrackData& td,
const scalar dt,
const label cellI,
const scalar Re,
const scalar Pr,
const scalar kappa,
const scalar d,
const scalar rho,
const scalar T,
const scalar cp,
const scalar NCpW,
const scalar Sh,
scalar& dhsTrans
)
{
if (!td.cloud().heatTransfer().active())
{
return T;
}
// Calc heat transfer coefficient
scalar htc = td.cloud().heatTransfer().htc(d, Re, Pr, kappa, NCpW);
if (mag(htc) < ROOTVSMALL && !td.cloud().radiation())
{
return max(T + dt*Sh/(this->volume(d)*rho*cp), td.constProps().TMin());
}
const scalar As = this->areaS(d);
scalar ap = Tc_ + Sh/As/htc;
scalar bp = 6.0*(Sh/As + htc*(Tc_ - T));
if (td.cloud().radiation())
{
const scalarField& G =
td.cloud().mesh().objectRegistry::template
lookupObject<volScalarField>("G");
const scalar Gc = G[cellI];
const scalar sigma = radiation::sigmaSB.value();
const scalar epsilon = td.constProps().epsilon0();
ap = (ap + epsilon*Gc/(4.0*htc))/(1.0 + epsilon*sigma*pow3(T)/htc);
bp += 6.0*(epsilon*(Gc/4.0 - sigma*pow4(T)));
}
bp /= rho*d*cp*(ap - T);
// Integrate to find the new parcel temperature
IntegrationScheme<scalar>::integrationResult Tres =
td.cloud().TIntegrator().integrate(T, dt, ap, bp);
scalar Tnew = max(Tres.value(), td.constProps().TMin());
dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_);
return Tnew;
}
示例7: max
void Foam::ThermoParcel<ParcelType>::calcSurfaceValues
(
TrackData& td,
const label cellI,
const scalar T,
scalar& Ts,
scalar& rhos,
scalar& mus,
scalar& Pr,
scalar& kappas
) const
{
// Surface temperature using two thirds rule
Ts = (2.0*T + Tc_)/3.0;
if (Ts < td.cloud().constProps().TMin())
{
if (debug)
{
WarningIn
(
"void Foam::ThermoParcel<ParcelType>::calcSurfaceValues"
"("
"TrackData&, "
"const label, "
"const scalar, "
"scalar&, "
"scalar&, "
"scalar&, "
"scalar&, "
"scalar&"
") const"
) << "Limiting parcel surface temperature to "
<< td.cloud().constProps().TMin() << nl << endl;
}
Ts = td.cloud().constProps().TMin();
}
// Assuming thermo props vary linearly with T for small d(T)
const scalar TRatio = Tc_/Ts;
rhos = this->rhoc_*TRatio;
tetIndices tetIs = this->currentTetIndices();
mus = td.muInterp().interpolate(this->position(), tetIs)/TRatio;
Pr = td.cloud().constProps().Pr();
Pr = max(ROOTVSMALL, Pr);
kappas = Cpc_*mus/Pr;
kappas = max(ROOTVSMALL, kappas);
}
示例8:
const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
(
TrackData& td,
const scalar dt,
const label cellI,
const scalar Re,
const scalar mu,
const scalar mass,
const vector& Su,
vector& dUTrans,
scalar& Spu
) const
{
typedef typename TrackData::cloudType cloudType;
typedef typename cloudType::parcelType parcelType;
typedef typename cloudType::forceType forceType;
const forceType& forces = td.cloud().forces();
// Momentum source due to particle forces
const parcelType& p = static_cast<const parcelType&>(*this);
const forceSuSp Fcp = forces.calcCoupled(p, dt, mass, Re, mu);
const forceSuSp Fncp = forces.calcNonCoupled(p, dt, mass, Re, mu);
const forceSuSp Feff = Fcp + Fncp;
const scalar massEff = forces.massEff(p, mass);
// New particle velocity
//~~~~~~~~~~~~~~~~~~~~~~
// Update velocity - treat as 3-D
const vector abp = (Feff.Sp()*Uc_ + (Feff.Su() + Su))/massEff;
const scalar bp = Feff.Sp()/massEff;
Spu = dt*Feff.Sp();
IntegrationScheme<vector>::integrationResult Ures =
td.cloud().UIntegrator().integrate(U_, dt, abp, bp);
vector Unew = Ures.value();
// note: Feff.Sp() and Fc.Sp() must be the same
dUTrans += dt*(Feff.Sp()*(Ures.average() - Uc_) - Fcp.Su());
// Apply correction to velocity and dUTrans for reduced-D cases
const polyMesh& mesh = td.cloud().pMesh();
meshTools::constrainDirection(mesh, mesh.solutionD(), Unew);
meshTools::constrainDirection(mesh, mesh.solutionD(), dUTrans);
return Unew;
}
示例9: switch
bool Foam::CollidingParcel<ParcelType>::move
(
TrackData& td,
const scalar trackTime
)
{
typename TrackData::cloudType::parcelType& p =
static_cast<typename TrackData::cloudType::parcelType&>(*this);
switch (td.part())
{
case TrackData::tpVelocityHalfStep:
{
// First and last leapfrog velocity adjust part, required
// before and after tracking and force calculation
p.U() += 0.5*trackTime*p.f()/p.mass();
p.angularMomentum() += 0.5*trackTime*p.torque();
td.keepParticle = true;
td.switchProcessor = false;
break;
}
case TrackData::tpLinearTrack:
{
ParcelType::move(td, trackTime);
break;
}
case TrackData::tpRotationalTrack:
{
NotImplemented;
break;
}
default:
{
FatalErrorInFunction
<< td.part() << " is an invalid part of the tracking method."
<< abort(FatalError);
}
}
return td.keepParticle;
}
示例10: mass
void Foam::KinematicParcel<ParcelType>::calc
(
TrackData& td,
const scalar dt,
const label cellI
)
{
// Define local properties at beginning of time step
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const scalar np0 = nParticle_;
const scalar d0 = d_;
const vector U0 = U_;
const scalar rho0 = rho_;
const scalar mass0 = mass();
// Reynolds number
const scalar Re = this->Re(U0, d0, rhoc_, muc_);
// Sources
//~~~~~~~~
// Explicit momentum source for particle
vector Su = vector::zero;
// Momentum transfer from the particle to the carrier phase
vector dUTrans = vector::zero;
// Motion
// ~~~~~~
// Calculate new particle velocity
vector U1 =
calcVelocity(td, dt, cellI, Re, muc_, d0, U0, rho0, mass0, Su, dUTrans);
// Accumulate carrier phase source terms
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (td.cloud().coupled())
{
// Update momentum transfer
td.cloud().UTrans()[cellI] += np0*dUTrans;
}
// Set new particle properties
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
U_ = U1;
}
示例11:
Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::LEff
(
TrackData& td,
const scalar p,
const scalar T,
const label idG,
const label idL,
const label idS
) const
{
return
this->Y_[GAS]*td.cloud().composition().L(idG, YGas_, p, T)
+ this->Y_[LIQ]*td.cloud().composition().L(idL, YLiquid_, p, T)
+ this->Y_[SLD]*td.cloud().composition().L(idS, YSolid_, p, T);
}
示例12:
const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
(
TrackData& td,
const scalar dt,
const label cellI,
const scalar Re,
const scalar mu,
const scalar d,
const vector& U,
const scalar rho,
const scalar mass,
const vector& Su,
vector& dUTrans
) const
{
const polyMesh& mesh = this->cloud().pMesh();
// Momentum transfer coefficient
const scalar utc = td.cloud().drag().utc(Re, d, mu) + ROOTVSMALL;
// Momentum source due to particle forces
const vector FCoupled =
mass*td.cloud().forces().calcCoupled(cellI, dt, rhoc_, rho, Uc_, U);
const vector FNonCoupled =
mass*td.cloud().forces().calcNonCoupled(cellI, dt, rhoc_, rho, Uc_, U);
// New particle velocity
//~~~~~~~~~~~~~~~~~~~~~~
// Update velocity - treat as 3-D
const scalar As = this->areaS(d);
const vector ap = Uc_ + (FCoupled + FNonCoupled + Su)/(utc*As);
const scalar bp = 6.0*utc/(rho*d);
IntegrationScheme<vector>::integrationResult Ures =
td.cloud().UIntegrator().integrate(U, dt, ap, bp);
vector Unew = Ures.value();
dUTrans += dt*(utc*As*(Ures.average() - Uc_) - FCoupled);
// Apply correction to velocity and dUTrans for reduced-D cases
meshTools::constrainDirection(mesh, mesh.solutionD(), Unew);
meshTools::constrainDirection(mesh, mesh.solutionD(), dUTrans);
return Unew;
}
示例13: updateCellOccupancy
void Foam::KinematicCloud<CloudType>::motion(TrackData& td)
{
td.part() = TrackData::tpLinearTrack;
CloudType::move(td, solution_.trackTime());
updateCellOccupancy();
}
示例14: mass
void Foam::KinematicParcel<ParcelType>::calc
(
TrackData& td,
const scalar dt,
const label cellI
)
{
// Define local properties at beginning of time step
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const scalar np0 = nParticle_;
const scalar mass0 = mass();
// Reynolds number
const scalar Re = this->Re(U_, d_, rhoc_, muc_);
// Sources
//~~~~~~~~
// Explicit momentum source for particle
vector Su = vector::zero;
// Linearised momentum source coefficient
scalar Spu = 0.0;
// Momentum transfer from the particle to the carrier phase
vector dUTrans = vector::zero;
// Motion
// ~~~~~~
// Calculate new particle velocity
this->U_ = calcVelocity(td, dt, cellI, Re, muc_, mass0, Su, dUTrans, Spu);
// Accumulate carrier phase source terms
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (td.cloud().solution().coupled())
{
// Update momentum transfer
td.cloud().UTrans()[cellI] += np0*dUTrans;
// Update momentum transfer coefficient
td.cloud().UCoeff()[cellI] += np0*Spu;
}
}
示例15: course
void TCXParser::course(TrackData &track)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Track")
trackpoints(track);
else if (_reader.name() == "Name")
track.setName(_reader.readElementText());
else if (_reader.name() == "Notes")
track.setDescription(_reader.readElementText());
else if (_reader.name() == "CoursePoint") {
Waypoint w;
waypointData(w);
if (!w.coordinates().isNull())
_waypoints.append(w);
else
warning("Missing Trackpoint coordinates");
} else
_reader.skipCurrentElement();
}
}