diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/incompressibleUncoupledKinematicParcelDyMFoam.C b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/incompressibleUncoupledKinematicParcelDyMFoam.C index f5fba006e02b16e58ff06e24c1c1665879227ae0..40b642a2847305a95c745c96e6ad0f31aaead825 100644 --- a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/incompressibleUncoupledKinematicParcelDyMFoam.C +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/incompressibleUncoupledKinematicParcelDyMFoam.C @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" - # include "createDynamicFvMesh.H" + #include "createDynamicFvMesh.H" #include "readGravitationalAcceleration.H" #include "createFields.H" diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H index e77fe75dabbcc939eb6c1afae5cd969fe8b9dbd1..fee0fe1a6895a21115e870ee70b69e6ad945801a 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H @@ -6,7 +6,7 @@ + turbulence->divDevRhoReff(U) == rho.dimensionedInternalField()*g - + parcels.SU() + + parcels.SU(U) + momentumSource.Su() ); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H index f54be04bb8778fb886f21231f860439e426188d9..ac369f3df437deb7cc2849b953c3e7a078301682 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H @@ -26,7 +26,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection + mvConvection->fvmDiv(phi, Yi) - fvm::laplacian(turbulence->muEff(), Yi) == - parcels.Srho(i) + parcels.SYi(i, Yi) + kappa*chemistry.RR(i)().dimensionedInternalField() + massSource.Su(i), mesh.solver("Yi") diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H index 73c276c2942d857e689c31bfeba9ed9cac565a68..f448144f1639cd43e0014a07318be82f8ebb4a88 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H @@ -37,7 +37,7 @@ - fvm::laplacian(turbulence->alphaEff(), hs) == pWork() - + parcels.Sh() + + parcels.Sh(hs) + radiation->Shs(thermo) + energySource.Su() + chemistrySh diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H index 0dea187edac01b32f3d636cfe4672bebad3754c1..b1770a5a9d56b0b94c6431caf2b1d1adeadf3cb4 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H @@ -35,7 +35,7 @@ Description fvm::ddt(rho) + fvc::div(phi) == - parcels.Srho() + parcels.Srho(rho) + massSource.SuTot() ); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H index 3c4a927091a474e5b8d0d4e50b2794a26202cc8a..2e8f979be419dba827b3cf63867d13db67c5aa92 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H @@ -5,7 +5,7 @@ + turbulence->divDevRhoReff(U) == rho.dimensionedInternalField()*g - + parcels.SU() + + parcels.SU(U) ); UEqn.relax(); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H index 0a2c36b7b50f53e5bee8f1d86a7e5b791dd79a6d..da9a289d69b0a2d5f0012c6e3f7d02c9f9733e74 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H @@ -25,7 +25,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection + mvConvection->fvmDiv(phi, Yi) - fvm::laplacian(turbulence->muEff(), Yi) == - parcels.Srho(i) + parcels.SYi(i, Yi) + surfaceFilm.Srho(i) + kappa*chemistry.RR(i)().dimensionedInternalField(), mesh.solver("Yi") diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/hsEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/hsEqn.H index 3c76f1384c8bc5d2d9f1c75906d41ceea6523b22..0cb2318252b46fbb7734e0fd5b46b3abd9dbb7a3 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/hsEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/hsEqn.H @@ -6,7 +6,7 @@ - fvm::laplacian(turbulence->alphaEff(), hs) == DpDt - + parcels.Sh() + + parcels.Sh(hs) + surfaceFilm.Sh() + radiation->Shs(thermo) + chemistrySh diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/rhoEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/rhoEqn.H index 2c5d41f4fe5f3b0a48fd10f968bed824ae738ae7..617f1df8a64a0a2dd875e401948334968037fd3b 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/rhoEqn.H @@ -35,7 +35,7 @@ Description fvm::ddt(rho) + fvc::div(phi) == - parcels.Srho() + parcels.Srho(rho) + surfaceFilm.Srho() ); } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H index 3c4a927091a474e5b8d0d4e50b2794a26202cc8a..2e8f979be419dba827b3cf63867d13db67c5aa92 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H @@ -5,7 +5,7 @@ + turbulence->divDevRhoReff(U) == rho.dimensionedInternalField()*g - + parcels.SU() + + parcels.SU(U) ); UEqn.relax(); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H index c687f2035ba3fb4bb6d48efcd631d052eb189fce..c4a929c44943a4c175103efc96b1acc4676f8d95 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H @@ -25,7 +25,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection + mvConvection->fvmDiv(phi, Yi) - fvm::laplacian(turbulence->muEff(), Yi) == - parcels.Srho(i) + parcels.SYi(i, Yi) + kappa*chemistry.RR(i)().dimensionedInternalField(), mesh.solver("Yi") ); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H index ce12ec3ad48f74de6a2977558cead524ffc6e460..7821d340d4bc6b1f955b94dcb770fd9454acdf95 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H @@ -6,7 +6,7 @@ - fvm::laplacian(turbulence->alphaEff(), hs) == DpDt - + parcels.Sh() + + parcels.Sh(hs) + radiation->Shs(thermo) + chemistrySh ); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H index b9b2d6a13f9ccfcced687b62d96a2c7adbb3b217..d4f69d8f600f6dd96293131e84aa6f8144ec4563 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H @@ -35,7 +35,7 @@ Description fvm::ddt(rho) + fvc::div(phi) == - parcels.Srho() + parcels.Srho(rho) ); } diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C index b77b68d1e88d7e52e412b9e947bc7330dec457c6..10c6d9c300ff9402701fb9f315830d50af7c19b4 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C @@ -327,7 +327,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField const PtrList<PatchField<Type> >& ptfl ) : - DimensionedField<Type, GeoMesh>(io, mesh, ds, iField, false), + DimensionedField<Type, GeoMesh>(io, mesh, ds, iField), timeIndex_(this->time().timeIndex()), field0Ptr_(NULL), fieldPrevIterPtr_(NULL), diff --git a/src/lagrangian/dieselSpray/parcel/parcel.C b/src/lagrangian/dieselSpray/parcel/parcel.C index 3862508f7a58e7ec3f676833afa69092f3ed82a6..d9249bf66e95502affc71fe268ff51211ab5577c 100644 --- a/src/lagrangian/dieselSpray/parcel/parcel.C +++ b/src/lagrangian/dieselSpray/parcel/parcel.C @@ -94,14 +94,13 @@ Foam::parcel::parcel // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::parcel::move(spray& sDB) +bool Foam::parcel::move(spray& sDB, const scalar trackTime) { const polyMesh& mesh = cloud().pMesh(); const polyBoundaryMesh& pbMesh = mesh.boundaryMesh(); const liquidMixture& fuels = sDB.fuels(); - scalar deltaT = sDB.runTime().deltaTValue(); label Nf = fuels.components().size(); label Ns = sDB.composition().Y().size(); @@ -156,12 +155,12 @@ bool Foam::parcel::move(spray& sDB) pg, Yfg, m()*fuels.Y(X()), - deltaT + trackTime ); // set the end-time for the track - scalar tEnd = (1.0 - stepFraction())*deltaT; + scalar tEnd = (1.0 - stepFraction())*trackTime; // set the maximum time step for this parcel scalar dtMax = min @@ -215,7 +214,7 @@ bool Foam::parcel::move(spray& sDB) tEnd -= dt; // Set the current time-step fraction. - stepFraction() = 1.0 - tEnd/deltaT; + stepFraction() = 1.0 - tEnd/trackTime; if (onBoundary()) // hit face { diff --git a/src/lagrangian/dieselSpray/parcel/parcel.H b/src/lagrangian/dieselSpray/parcel/parcel.H index 90d46e0231e4d51f38255c66cf962c88693c6340..db4afe7922b675f6a0975d3559e0c746e75b0c7d 100644 --- a/src/lagrangian/dieselSpray/parcel/parcel.H +++ b/src/lagrangian/dieselSpray/parcel/parcel.H @@ -349,7 +349,7 @@ public: // Parcel operations - bool move(spray& sprayData); + bool move(spray& sprayData, const scalar trackTime); //- Transform the position and physical properties of the particle // according to the given transformation tensor diff --git a/src/lagrangian/dieselSpray/spray/sprayInject.C b/src/lagrangian/dieselSpray/spray/sprayInject.C index 06dbc9b7c6160aae62ed2fd345c028f9c1c875a4..022c119e11a98e17f8cc66c84e5e44b34bf81402 100644 --- a/src/lagrangian/dieselSpray/spray/sprayInject.C +++ b/src/lagrangian/dieselSpray/spray/sprayInject.C @@ -159,7 +159,8 @@ void Foam::spray::inject() (runTime_.deltaTValue() - dt) /runTime_.deltaTValue(); - bool keepParcel = pPtr->move(*this); + bool keepParcel = + pPtr->move(*this, runTime_.deltaTValue()); if (keepParcel) { diff --git a/src/lagrangian/dieselSpray/spray/sprayOps.C b/src/lagrangian/dieselSpray/spray/sprayOps.C index 7904771fa14cb31e5eeb3f73ef832f2a435ec9a5..9ac54f2b70ae924e1962e01bfab0d91f5360242c 100644 --- a/src/lagrangian/dieselSpray/spray/sprayOps.C +++ b/src/lagrangian/dieselSpray/spray/sprayOps.C @@ -76,7 +76,7 @@ void Foam::spray::move() srhos_[i] = 0.0; } - Cloud<parcel>::move(*this); + Cloud<parcel>::move(*this, runTime_.deltaTValue()); } diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C index 8b92319bcb545972c6305688344ca8f8aecab161..495c49b6e9b8baecdef0a4c063721fc2b53d9e27 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C @@ -984,7 +984,7 @@ void Foam::DsmcCloud<ParcelType>::evolve() this->inflowBoundary().inflow(); // Move the particles ballistically with their current velocities - Cloud<ParcelType>::move(td); + Cloud<ParcelType>::move(td, mesh_.time().deltaTValue()); // Update cell occupancy buildCellOccupancy(); diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C index a6a6949122c7204d7c21d55ac59b4dfac034858b..843a96456f88ecdd94a344b4c2756cd08bbba0c8 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C @@ -32,7 +32,8 @@ template<class ParcelType> template<class TrackData> bool Foam::DsmcParcel<ParcelType>::move ( - TrackData& td + TrackData& td, + const scalar trackTime ) { ParcelType& p = static_cast<ParcelType&>(*this); @@ -43,8 +44,7 @@ bool Foam::DsmcParcel<ParcelType>::move const polyMesh& mesh = td.cloud().pMesh(); const polyBoundaryMesh& pbMesh = mesh.boundaryMesh(); - const scalar deltaT = mesh.time().deltaTValue(); - scalar tEnd = (1.0 - p.stepFraction())*deltaT; + scalar tEnd = (1.0 - p.stepFraction())*trackTime; const scalar dtMax = tEnd; // For reduced-D cases, the velocity used to track needs to be @@ -71,7 +71,7 @@ bool Foam::DsmcParcel<ParcelType>::move tEnd -= dt; - p.stepFraction() = 1.0 - tEnd/deltaT; + p.stepFraction() = 1.0 - tEnd/trackTime; if (p.onBoundary() && td.keepParticle) { diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H index 8d09a91e8d7db8558a82236fa7e72462d58c59da..6047911db0123e9019e774c264c7860233d7961d 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H @@ -200,9 +200,12 @@ public: ); //- Construct and return a clone - autoPtr<ParcelType> clone() const + virtual autoPtr<Particle<ParcelType> > clone() const { - return autoPtr<ParcelType>(new DsmcParcel<ParcelType>(*this)); + return autoPtr<Particle<ParcelType> > + ( + new DsmcParcel<ParcelType>(*this) + ); } @@ -234,7 +237,7 @@ public: //- Move the parcel template<class TrackData> - bool move(TrackData& td); + bool move(TrackData& td, const scalar trackTime); // Patch interactions diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.H b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.H index 6286e06c60e10fd81fafd6929c13eefc6a99fc1e..35a6c2d486abe3845f593c48d77c591e639c57b3 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.H +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.H @@ -81,9 +81,9 @@ public: ); //- Construct and return a clone - autoPtr<dsmcParcel> clone() const + autoPtr<Particle<dsmcParcel> > clone() const { - return autoPtr<dsmcParcel>(new dsmcParcel(*this)); + return autoPtr<Particle<dsmcParcel> >(new dsmcParcel(*this)); } diff --git a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C index ef3b1395cc8e41dab90834f0c9c4815178437de0..7742ecc88690d52449f9ca72245333501b25985e 100644 --- a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C +++ b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C @@ -80,29 +80,27 @@ Foam::molecule::trackData::trackData // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::molecule::move(molecule::trackData& td) +bool Foam::molecule::move(molecule::trackData& td, const scalar trackTime) { td.switchProcessor = false; td.keepParticle = true; const constantProperties& constProps(td.molCloud().constProps(id_)); - scalar deltaT = cloud().pMesh().time().deltaTValue(); - if (td.part() == 0) { // First leapfrog velocity adjust part, required before tracking+force // part - v_ += 0.5*deltaT*a_; + v_ += 0.5*trackTime*a_; - pi_ += 0.5*deltaT*tau_; + pi_ += 0.5*trackTime*tau_; } else if (td.part() == 1) { // Leapfrog tracking part - scalar tEnd = (1.0 - stepFraction())*deltaT; + scalar tEnd = (1.0 - stepFraction())*trackTime; scalar dtMax = tEnd; while (td.keepParticle && !td.switchProcessor && tEnd > ROOTVSMALL) @@ -113,7 +111,7 @@ bool Foam::molecule::move(molecule::trackData& td) dt *= trackToFace(position() + dt*v_, td); tEnd -= dt; - stepFraction() = 1.0 - tEnd/deltaT; + stepFraction() = 1.0 - tEnd/trackTime; } } else if (td.part() == 2) @@ -130,26 +128,26 @@ bool Foam::molecule::move(molecule::trackData& td) if (!constProps.linearMolecule()) { - R = rotationTensorX(0.5*deltaT*pi_.x()/momentOfInertia.xx()); + R = rotationTensorX(0.5*trackTime*pi_.x()/momentOfInertia.xx()); pi_ = pi_ & R; Q_ = Q_ & R; } - R = rotationTensorY(0.5*deltaT*pi_.y()/momentOfInertia.yy()); + R = rotationTensorY(0.5*trackTime*pi_.y()/momentOfInertia.yy()); pi_ = pi_ & R; Q_ = Q_ & R; - R = rotationTensorZ(deltaT*pi_.z()/momentOfInertia.zz()); + R = rotationTensorZ(trackTime*pi_.z()/momentOfInertia.zz()); pi_ = pi_ & R; Q_ = Q_ & R; - R = rotationTensorY(0.5*deltaT*pi_.y()/momentOfInertia.yy()); + R = rotationTensorY(0.5*trackTime*pi_.y()/momentOfInertia.yy()); pi_ = pi_ & R; Q_ = Q_ & R; if (!constProps.linearMolecule()) { - R = rotationTensorX(0.5*deltaT*pi_.x()/momentOfInertia.xx()); + R = rotationTensorX(0.5*trackTime*pi_.x()/momentOfInertia.xx()); pi_ = pi_ & R; Q_ = Q_ & R; } @@ -177,9 +175,9 @@ bool Foam::molecule::move(molecule::trackData& td) tau_ += (constProps.siteReferencePositions()[s] ^ (Q_.T() & f)); } - v_ += 0.5*deltaT*a_; + v_ += 0.5*trackTime*a_; - pi_ += 0.5*deltaT*tau_; + pi_ += 0.5*trackTime*tau_; if (constProps.pointMolecule()) { diff --git a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H index 8df55ca8faf34c9f4647a7a31d4270cba2af81fe..622f8376b33ac4ede545c9e90b38dc3fc167d939 100644 --- a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H +++ b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H @@ -251,9 +251,9 @@ public: ); //- Construct and return a clone - autoPtr<molecule> clone() const + autoPtr<Particle<molecule> > clone() const { - return autoPtr<molecule>(new molecule(*this)); + return autoPtr<Particle<molecule> >(new molecule(*this)); } @@ -261,7 +261,7 @@ public: // Tracking - bool move(trackData&); + bool move(trackData&, const scalar trackTime); void transformProperties(const tensor& T); diff --git a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C index da5f1ce1ddcc116166a202fed2a5157aa58ef821..413f0e1f225f4b702f4ae5583ea027caaaec69e1 100644 --- a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C +++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C @@ -1160,18 +1160,18 @@ Foam::moleculeCloud::moleculeCloud void Foam::moleculeCloud::evolve() { molecule::trackData td0(*this, 0); - Cloud<molecule>::move(td0); + Cloud<molecule>::move(td0, mesh_.time().deltaTValue()); molecule::trackData td1(*this, 1); - Cloud<molecule>::move(td1); + Cloud<molecule>::move(td1, mesh_.time().deltaTValue()); molecule::trackData td2(*this, 2); - Cloud<molecule>::move(td2); + Cloud<molecule>::move(td2, mesh_.time().deltaTValue()); calculateForce(); molecule::trackData td3(*this, 3); - Cloud<molecule>::move(td3); + Cloud<molecule>::move(td3, mesh_.time().deltaTValue()); } diff --git a/src/lagrangian/solidParticle/solidParticle.C b/src/lagrangian/solidParticle/solidParticle.C index e802e67d06a2f88858778a8911b6753574fe13b7..e8cd324a68f601549906b3911a977262a61ceb18 100644 --- a/src/lagrangian/solidParticle/solidParticle.C +++ b/src/lagrangian/solidParticle/solidParticle.C @@ -27,7 +27,11 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::solidParticle::move(solidParticle::trackData& td) +bool Foam::solidParticle::move +( + solidParticle::trackData& td, + const scalar trackTime +) { td.switchProcessor = false; td.keepParticle = true; @@ -35,8 +39,7 @@ bool Foam::solidParticle::move(solidParticle::trackData& td) const polyMesh& mesh = cloud().pMesh(); const polyBoundaryMesh& pbMesh = mesh.boundaryMesh(); - scalar deltaT = mesh.time().deltaTValue(); - scalar tEnd = (1.0 - stepFraction())*deltaT; + scalar tEnd = (1.0 - stepFraction())*trackTime; scalar dtMax = tEnd; while (td.keepParticle && !td.switchProcessor && tEnd > SMALL) @@ -44,7 +47,7 @@ bool Foam::solidParticle::move(solidParticle::trackData& td) if (debug) { Info<< "Time = " << mesh.time().timeName() - << " deltaT = " << deltaT + << " trackTime = " << trackTime << " tEnd = " << tEnd << " steptFraction() = " << stepFraction() << endl; } @@ -59,7 +62,7 @@ bool Foam::solidParticle::move(solidParticle::trackData& td) dt *= trackToFace(position() + dt*U_, td); tEnd -= dt; - stepFraction() = 1.0 - tEnd/deltaT; + stepFraction() = 1.0 - tEnd/trackTime; cellPointWeight cpw(mesh, position(), cellI, face()); scalar rhoc = td.rhoInterp().interpolate(cpw); diff --git a/src/lagrangian/solidParticle/solidParticle.H b/src/lagrangian/solidParticle/solidParticle.H index 04ff8e9e51002b77e734394c3057b4a1122783f9..e00e4a6422ffa021d55a4c9c2c3cbef0cb796d1e 100644 --- a/src/lagrangian/solidParticle/solidParticle.H +++ b/src/lagrangian/solidParticle/solidParticle.H @@ -143,9 +143,9 @@ public: ); //- Construct and return a clone - autoPtr<solidParticle> clone() const + virtual autoPtr<Particle<solidParticle> > clone() const { - return autoPtr<solidParticle>(new solidParticle(*this)); + return autoPtr<Particle<solidParticle> >(new solidParticle(*this)); } @@ -167,7 +167,7 @@ public: // Tracking //- Move - bool move(trackData&); + bool move(trackData&, const scalar); // Patch interactions diff --git a/src/lagrangian/solidParticle/solidParticleCloud.C b/src/lagrangian/solidParticle/solidParticleCloud.C index 625116d525c68db7793f76bdc0aa0c480ac0a743..cc4543cb6a0a8b77d34f758ee450b98d9c0cb4f3 100644 --- a/src/lagrangian/solidParticle/solidParticleCloud.C +++ b/src/lagrangian/solidParticle/solidParticleCloud.C @@ -83,7 +83,7 @@ void Foam::solidParticleCloud::move(const dimensionedVector& g) solidParticle::trackData td(*this, rhoInterp, UInterp, nuInterp, g.value()); - Cloud<solidParticle>::move(td); + Cloud<solidParticle>::move(td, mesh_.time().deltaTValue()); } diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C index bda9fc6e8e9b1b14b7dc081112ea0721dfdbf067..7c445b243218543d5a828fca915090919a479191 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C @@ -333,7 +333,7 @@ Foam::label Foam::meshRefinement::markFeatureRefinement trackedParticle::trackData td(cloud, maxFeatureLevel); // Track all particles to their end position (= starting feature point) - cloud.move(td); + cloud.move(td, mesh_.time().deltaTValue()); // Reset level maxFeatureLevel = -1; @@ -406,7 +406,7 @@ Foam::label Foam::meshRefinement::markFeatureRefinement } // Track all particles to their end position. - cloud.move(td); + cloud.move(td, mesh_.time().deltaTValue()); } diff --git a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C index 5714b3062eeb861ba34c4267b3678be7843ab2af..49c0fccdc42e248dd824594067bf2273bf402ca3 100644 --- a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C +++ b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C @@ -27,7 +27,6 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -//- Construct from components Foam::trackedParticle::trackedParticle ( const Cloud<trackedParticle>& c, @@ -49,7 +48,6 @@ Foam::trackedParticle::trackedParticle {} -//- Construct from Istream Foam::trackedParticle::trackedParticle ( const Cloud<trackedParticle>& c, @@ -89,13 +87,16 @@ Foam::trackedParticle::trackedParticle // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::trackedParticle::move(trackedParticle::trackData& td) +bool Foam::trackedParticle::move +( + trackedParticle::trackData& td, + const scalar trackedParticle +) { td.switchProcessor = false; td.keepParticle = true; - scalar deltaT = cloud().pMesh().time().deltaTValue(); - scalar tEnd = (1.0 - stepFraction())*deltaT; + scalar tEnd = (1.0 - stepFraction())*trackedParticle; scalar dtMax = tEnd; while (td.keepParticle && !td.switchProcessor && tEnd > SMALL) @@ -109,7 +110,7 @@ bool Foam::trackedParticle::move(trackedParticle::trackData& td) dt *= trackToFace(end_, td); tEnd -= dt; - stepFraction() = 1.0 - tEnd/deltaT; + stepFraction() = 1.0 - tEnd/trackedParticle; } return td.keepParticle; diff --git a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H index 1f62e6f37a575a55bb22e280b71da48c10004832..a376d672ad79a9e4e275cef06e68d55bbafdc6e9 100644 --- a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H +++ b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H @@ -47,7 +47,7 @@ namespace Foam class trackedParticleCloud; /*---------------------------------------------------------------------------*\ - Class trackedParticle Declaration + Class trackedParticle Declaration \*---------------------------------------------------------------------------*/ class trackedParticle @@ -68,6 +68,7 @@ class trackedParticle //- passive label label j_; + public: friend class Cloud<trackedParticle>; @@ -135,9 +136,12 @@ public: ); //- Construct and return a clone - autoPtr<trackedParticle> clone() const + autoPtr<Particle<trackedParticle> > clone() const { - return autoPtr<trackedParticle>(new trackedParticle(*this)); + return autoPtr<Particle<trackedParticle> > + ( + new trackedParticle(*this) + ); } @@ -166,7 +170,7 @@ public: // Tracking //- Track all particles to their end point - bool move(trackData&); + bool move(trackData&, const scalar); //- Overridable function to handle the particle hitting a patch diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLine.C b/src/postProcessing/functionObjects/field/streamLine/streamLine.C index 8336fd8f9a9144b8f3465e144421547b81b63a1a..f052f0580e0550dccd0871e5a25e2b9ff6933cba 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLine.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLine.C @@ -233,10 +233,13 @@ void Foam::streamLine::track() allVectors_ ); + + // Set very large dt. Note: cannot use GREAT since 1/GREAT is SMALL + // which is a trigger value for the tracking... + const scalar trackTime = Foam::sqrt(GREAT); + // Track - //Pout<< "Tracking particles." << endl; - particles.move(td); - //Pout<< "Finished tracking particles." << endl; + particles.move(td, trackTime); } diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C index 56b05c88caf9b1f39c3ebf21f79258629363ce7f..406a1177b2a0d4997f154cfcf2713cb380bb4053 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C @@ -152,15 +152,16 @@ Foam::streamLineParticle::streamLineParticle // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::streamLineParticle::move(streamLineParticle::trackData& td) +bool Foam::streamLineParticle::move +( + streamLineParticle::trackData& td, + const scalar trackTime +) { td.switchProcessor = false; td.keepParticle = true; - // Set very large dt. Note: cannot use GREAT since 1/GREAT is SMALL - // which is a trigger value for the tracking... - scalar deltaT = Foam::sqrt(GREAT); //cloud().pMesh().time().deltaTValue(); - scalar tEnd = (1.0 - stepFraction())*deltaT; + scalar tEnd = (1.0 - stepFraction())*trackTime; scalar dtMax = tEnd; while @@ -189,7 +190,7 @@ bool Foam::streamLineParticle::move(streamLineParticle::trackData& td) dt *= trackToFace(position()+dt*U, td); tEnd -= dt; - stepFraction() = 1.0 - tEnd/deltaT; + stepFraction() = 1.0 - tEnd/trackTime; if (tEnd <= ROOTVSMALL) { diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.H b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.H index d556e4791decf15ab076f885143fe1adb7b3f1d1..a7eb9f33ffdd8039af8d1965cd47d67e958b9fb5 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.H +++ b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.H @@ -157,9 +157,9 @@ public: streamLineParticle(const streamLineParticle& c); //- Construct and return a clone - autoPtr<streamLineParticle> clone() const + autoPtr<Particle<streamLineParticle> > clone() const { - return autoPtr<streamLineParticle> + return autoPtr<Particle<streamLineParticle> > ( new streamLineParticle(*this) ); @@ -173,7 +173,7 @@ public: // Tracking //- Track all particles to their end point - bool move(trackData&); + bool move(trackData&, const scalar trackTime); //- Overridable function to handle the particle hitting a patch